Minimum Direction Changes for Grid Navigation - Coding problem | OneNoughtOne