Cses Problem Set Subarray In Java