UVa 11991: Easy Problem from Rujia Liu? simplified problem statement: You are given an array of integers and asked to answer a series of queries. Each query is of the form: “What is the index in the array of the ith occurance of the number j?” This is another good adjacency list practice problem. By keeping an adjacency list of the indexes at which each number can be found, the queries can be answered in constant time!
UVa 11991: Easy Problem from Rujia Liu?
For technical reasons, comments are temporarily unavailable on my posts. If you'd like to discuss this article with me, feel free to email me at or hit me up on Twitter.