Simple Solution | Beginner Friendly | Easy Approach with Explanation✅
Intuition\n Describe your first thoughts on how to solve this problem. \n- The task is to find the smallest index where the condition i % 10 == nums[i] holds tr
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n- The task is to find the smallest index where the condition i % 10 == nums[i] holds true.\n- We need to check each index i and compare the value at that index with i % 10. If a match is found, return the index.\n- If no such index exists, return -1. Since the problem asks for the smallest such index, we can return the first one we find.\n\n# Approach\n1. Iterate over the array `nums` and check if the current index `i` satisfies the condition `i % 10 == nums[i]`.\n2. If a match is found, return the index `i` immediately.\n3. If no match is found after checking all indices, return -1.\n\n# Code\n```javascript []\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar smallestEqual = function(nums) {\n    for(let i=0;i<nums.length;i++){\n        if(i%10==nums[i]) {\n            return i\n        }\n    }\n    return -1\n};\n```\n\n```typescript []\nfunction smallestEqual(nums: number[]): number {\n    for (let i = 0; i < nums.length; i++) {\n        if (i % 10 === nums[i]) {\n            return i;\n        }\n    }\n    return -1;\n};
['TypeScript', 'JavaScript']