String Segmentation - Coding problem | OneNoughtOne