Added Pair data structure.
[algo2] Updated answer for ps3.