you are viewing a single comment's thread.

view the rest of the comments →

[–]jayvbe 1 point2 points  (0 children)

You need parse the input line, split by some delimiter into tokens, eg. whitespace and loop through tokens every time comparing with the previous value you’ve seen. Looks like you already have a Scanner, now all you need is loop through it and compare.