LeetCode solutions

2181. Smallest Index With Equal Value

My accepted Python solution to LeetCode problem 2181, Smallest Index With Equal Value, running in 0ms.

  • Difficulty: Easy
  • Python
  • Runtime 0ms
  • Memory 17.6MB

Read the problem on LeetCode View on GitHub

Python

Accepted on LeetCode — runtime 0ms, memory 17.6MB, accepted 2025-12-31.

python
class Solution:
    def smallestEqual(self, nums: List[int]) -> int:
        for i, num in enumerate(nums):
            if i % 10 == num:
                return i
        return -1

Source