Skip to content

Commit 406e340

Browse files
committed
add q1365 draft
1 parent cde9798 commit 406e340

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
Author :- Rishabh Jain <contact@rishabh1403.com>
3+
Solution for :- https://leetcode.com/problems/missing-number/
4+
blog for this code :- https://rishabh1403.com/posts/coding/leetcode/2020/03/leetcode-missing-number
5+
youtube video :- https://youtu.be/I6AUMvi13fc
6+
*/
7+
8+
9+
var smallerNumbersThanCurrent = function (nums) {
10+
const sorted = [...nums].sort((a, b) => a - b);
11+
12+
return nums.map(num => sorted.indexOf(num));
13+
};

0 commit comments

Comments
 (0)