Unique Arrangements - Coding problem | OneNoughtOne