In the Arrays section, you solved two-sum on a sorted array using two pointers. But what if the array isn't sorted?
You could sort it first (), but that changes indices. What if you need the original indices? Hash maps solve this in without sorting. The idea: for each element , check if exists.