Picking Numbers Hackerrank Solution Java