Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.
Click here
Multiple memory and speed solutions. Use hash table to save target:[indices]. Return random index from array. O(n) time, O(n) space.Run make to run python and Swift files.