Argusoft Interview Question

puzzle and one string based code