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
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.6MB, accepted 2025-12-31.
class Solution:
def smallestEqual(self, nums: List[int]) -> int:
for i, num in enumerate(nums):
if i % 10 == num:
return i
return -1