Apple interview question

Java technical coding problem in coderpad