HCLTech Interview Question

puzzle java program and hurdle works