Thanks :) I attempted again given what you said, also considering the eye-opener that argggh pointed out. I tried hard using some comparison heuristic approach before resigning to the fact that this is really a combinatorial problem.
Comment on Re^3: Perl Solution to Spotify Programming Puzzle