Contents

• # For Solution

Given a 0-indexed integer array `nums`, return the smallest index `i` of `nums` such that `i mod 10 == nums[i]`, or `-1` if such index does not exist.

`x mod y` denotes the remainder when `x` is divided by `y`.

Example 1:

## Smallest Index With Equal Value solution leetcode

```Input: nums = [0,1,2]
Output: 0
Explanation:
i=0: 0 mod 10 = 0 == nums.
i=1: 1 mod 10 = 1 == nums.
i=2: 2 mod 10 = 2 == nums.
All indices have i mod 10 == nums[i], so we return the smallest index 0.
```

Example 2:

## Smallest Index With Equal Value solution leetcode

```Input: nums = [4,3,2,1]
Output: 2
Explanation:
i=0: 0 mod 10 = 0 != nums.
i=1: 1 mod 10 = 1 != nums.
i=2: 2 mod 10 = 2 == nums.
i=3: 3 mod 10 = 3 != nums.
2 is the only index which has i mod 10 == nums[i].
```

Example 3:

## Smallest Index With Equal Value solution leetcode

```Input: nums = [1,2,3,4,5,6,7,8,9,0]
Output: -1
Explanation: No index satisfies i mod 10 == nums[i].
```

Example 4:

```Input: nums = [2,1,3,5,2]
Output: 1
Explanation: 1 is the only index with i mod 10 == nums[i].
```

Constraints:

## Smallest Index With Equal Value solution leetcode

• `1 <= nums.length <= 100`
• `0 <= nums[i] <= 9`