Skip to content

Commit

Permalink
add 2057
Browse files Browse the repository at this point in the history
  • Loading branch information
fishercoder1534 committed Oct 31, 2021
1 parent a2213ae commit b8bf1d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★

| # | Title | Solutions | Video | Difficulty | Tag
|-----|----------------|---------------|--------|-------------|-------------
|2057|[Smallest Index With Equal Value](https://leetcode.com/problems/smallest-index-with-equal-value/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2057.java) ||Easy||
|2055|[Plates Between Candles](https://leetcode.com/problems/plates-between-candles/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2055.java) ||Medium||
|2054|[Two Best Non-Overlapping Events](https://leetcode.com/problems/two-best-non-overlapping-events/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2054.java) ||Medium||
|2053|[Kth Distinct String in an Array](https://leetcode.com/problems/kth-distinct-string-in-an-array/)|[Java](../master/src/main/java/com/fishercoder/solutions/_2053.java) ||Easy||
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/fishercoder/solutions/_2057.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.fishercoder.solutions;

public class _2057 {
public static class Solution1 {
public int smallestEqual(int[] nums) {
for (int i = 0; i < nums.length; i++) {
if (i % 10 == nums[i]) {
return i;
}
}
return -1;
}
}
}

0 comments on commit b8bf1d8

Please sign in to comment.