Practice
Leaderboard
Profile
Login
Logout
Code Practice
Code Practice
//Returns the kth index (0 based) of the given number in the given array. //If there is no kth index of the given num, -1 is returned. //Examples: // kthIndexOf([1,1], 2, 1) -> 1 // kthIndexOf([1,2,3,2,1], 1, 3) -> 2 // kthIndexOf([1,2,3,4], 2, 3) -> -1 // kthIndexOf([1,2,3,4], 1, 5) -> -1 //Constraints: // 1 <= arr.length <= 1000 // 1 <= k <= 1000 // -2147483647 <= num <= 2147483647 function kthIndexOf(arr, k, num) { return -1; }
Run Tests
Ran
0
tests