Stef Aucky wrote:
although could you be a little less cryptic? i don't quite get the hint
Tony Docherty wrote:
My first thoughts were, like Henry's, that the lecturers version wouldn't work but then you helpfully changed the 'l' to 'as' which cleared up the problem of seeing 'L' as '1'.
Tony Docherty wrote:Welcome to the Ranch.
My first thoughts were, like Henry's, that the lecturers version wouldn't work but then you helpfully changed the 'l' to 'as' which cleared up the problem of seeing 'L' as '1'.
It works because you are comparing every number with every number (including itself) and so if there are no duplicates there will be exactly 'as' matches (ie 1 match for every element in the array because every element only matches itself).
All things are lawful, but not all things are profitable.
All things are lawful, but not all things are profitable.
Henry Wong wrote:
Just break out of the loops*.
Henry
* of course, this second suggestion may open a can of worms, as we want to break out of two loops.
That isn't how you enter command‑line arguments. You simply writeStef Aucky wrote:. . . any number of ints in the command line, . . . "1, 2, 3, 4, 5, 6, 7, 8, 9, 10," . . .
Just the arguments. No quote marks (unless you need to join two words into one argument), no commas, no nothing.java MyApp 1 2 3 4 5 6 7 8 9 10
You should have anaesthetised me first, thenJunilu Lacar wrote:. . . No shame in doing that in a small, controlled environment. I beg to differ with whoever says otherwise.