Skip to content

Commit 323b9dc

Browse files
authored
Create 2057-smallest-index-with-equal-value.js
1 parent f9283c2 commit 323b9dc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* @param {number[]} nums
3+
* @return {number}
4+
*/
5+
var smallestEqual = function(nums) {
6+
const n = nums.length
7+
for(let i = 0; i < n; i++) {
8+
if(i % 10 === nums[i]) return i
9+
}
10+
return -1
11+
};

0 commit comments

Comments
 (0)