ZET interview question

Array based dsa problem related to pythogores theorem