Update Part1ii.java

final version