HCLTech interview question

puzzle java program and hurdle works