8000 Add solution #2119 · Sunildhangar/leetcode-javascript@151962b · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 151962b

Browse files
committed
Add solution #2119
1 parent 25d7607 commit 151962b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# 1,756 LeetCode solutions in JavaScript
1+
# 1,757 LeetCode solutions in JavaScript
22

33
[https://leetcodejavascript.com](https://leetcodejavascript.com)
44

@@ -1622,6 +1622,7 @@
16221622
2115|[Find All Possible Recipes from Given Supplies](./solutions/2115-find-all-possible-recipes-from-given-supplies.js)|Medium|
16231623
2116|[Check if a Parentheses String Can Be Valid](./solutions/2116-check-if-a-parentheses-string-can-be-valid.js)|Medium|
16241624
2117|[Abbreviating the Product of a Range](./solutions/2117-abbreviating-the-product-of-a-range.js)|Hard|
1625+
2119|[A Number After a Double Reversal](./solutions/2119-a-number-after-a-double-reversal.js)|Easy|
16251626
2127|[Maximum Employees to Be Invited to a Meeting](./solutions/2127-maximum-employees-to-be-invited-to-a-meeting.js)|Hard|
16261627
2129|[Capitalize the Title](./solutions/2129-capitalize-the-title.js)|Easy|
16271628
2130|[Maximum Twin Sum of a Linked List](./solutions/2130-maximum-twin-sum-of-a-linked-list.js)|Medium|
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* 2119. A Number After a Double Reversal
3+
939A * https://leetcode.com/problems/a-number-after-a-double-reversal/
4+
* Difficulty: Easy
5+
*
6+
* Reversing an integer means to reverse all its digits.
7+
* - For example, reversing 2021 gives 1202. Reversing 12300 gives 321 as the leading zeros
8+
* are not retained.
9+
*
10+
* Given an integer num, reverse num to get reversed1, then reverse reversed1 to get reversed2.
11+
* Return true if reversed2 equals num. Otherwise return false.
12+
*/
13+
14+
/**
15+
* @param {number} num
16+
* @return {boolean}
17+
*/
18+
var isSameAfterReversals = function(num) {
19+
return num === 0 || num % 10 !== 0;
20+
};

0 commit comments

Comments
 (0)
0