Java solution without using mod
Perhaps the point is to ask the follow up question to implement it without using mod.\n10*d1 + d2 is all possible indices which can only go up to 99 (constraint
Perhaps the point is to ask the follow up question to implement it without using mod.\n```10*d1 + d2``` is all possible indices which can only go up to 99 (constraints). ```(10*d1 + d2)%10 = d2```\n```java\n public int smallestEqual(int[] a) {\n        for (int d1 = 0; d1 <= 9; d1++)\n            for (int d2 = 0; d2 <= 9 && 10 * d1 + d2 < a.length; d2++)\n                if (d2 == a[d1 * 10 + d2])\n                    return d1 * 10 + d2;\n        return -1;\n    }
[]