• + 1 comment

    When i read it correctly, she walks through 'mylist' 3 times. If she would go through each element once and do the compareision in that loop, she would walk through the list only once.

    But because she also reads the input in a list and than splits it, she basicly is creating a temp list which isn't necessary. In java you can say (when using a Scanner) nextInt and don't even need a list at all.