Monday 16 September 2013

SPOJ IITKWPCO: Create Collections

This blog is intended to discuss many things of which algorithmic problems are a part.
So lets begin with a fairly simple problem Create Collections on spoj:
The problem can easily be solved by hashing as the constraints are really poor. By hashing, we can find out for each number whether a corresponding double number exists or not. Rest is simple :) Below is the accepted code for the problem:

No comments:

Post a Comment