SPOJ - A Needle in the Haystack