Algorithm by Java