💢☠💫Easiest👾Faster✅💯 Lesser🧠 🎯 C++✅Python3🐍✅Java✅C✅Python🐍✅C#✅💥🔥💫Explained☠💥🔥 Beats 💯
Intuition\n\n\nC++ []\nclass Solution {\npublic:\n    int smallestEqual(vector<int>& nums) {\n        for(int i = 0; i < nums.size(); ++i){\n            if(i % 
# Intuition\n![0ehh83fsnh811.jpg](https://assets.leetcode.com/users/images/eb04ae71-2ea9-4228-a32c-ab3c709800f8_1721495788.6675682.jpeg)\n![Screenshot 2024-07-20 224550.png](https://assets.leetcode.com/users/images/07dd1777-7b60-4655-8ff2-34b61e8d2ad1_1721495798.0894344.png)\n```C++ []\nclass Solution {\npublic:\n    int smallestEqual(vector<int>& nums) {\n        for(int i = 0; i < nums.size(); ++i){\n            if(i % 10 == nums[i])\n                return i;\n        }\n        return -1;\n    }\n};\n```\n```python3 []\nclass Solution:\n    def smallestEqual(self, nums: List[int]) -> int:\n        for i in range(len(nums)):\n            if i % 10 == nums[i]:\n                return i\n        return  -1 \n```\n```C# []\npublic class Solution {\n    public int SmallestEqual(int[] nums) {\n        for(int i = 0; i < nums.Length; ++i){\n            if(i % 10 == nums[i])\n                return i;\n        }\n        return -1;\n    }\n}\n```\n```Java []\nclass Solution {\n    public int smallestEqual(int[] nums) {\n        int i = 0;\n        int n = nums.length;\n        while(i < n){\n            if(i % 10 == nums[i])\n                return i;\n            i++;\n        }\n        return -1;\n    }\n}\n```\n```python []\nclass Solution(object):\n    def smallestEqual(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: int\n        """\n        for u in range(len(nums)):\n            if u % 10 == nums[u]:\n                return u\n        return -1\n```\n```C []\nint smallestEqual(int* nums, int numsSize) {\n    for(int i = 0; i < numsSize; ++i){\n        if(i % 10 == nums[i])\n            return i;\n    }\n    return -1;\n}\n```\n\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n    O(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n    O(1)\n# Code\n```\nclass Solution {\n    public int smallestEqual(int[] nums) {\n        int i = 0;\n        int n = nums.length;\n        while(i < n){\n            if(i % 10 == nums[i])\n                return i;\n            i++;\n        }\n        return -1;\n    }\n}\n```\n![th.jpeg](https://assets.leetcode.com/users/images/68453c77-845b-469a-9f2a-d08ecf1fa366_1721495919.8878152.jpeg)\n
['Array', 'Math', 'C', 'Python', 'C++', 'Java', 'Python3', 'C#']