Predict the number moderate challenge solved in java