Cognizant Interview Question

They asked a question that could easily be solved with an array.