Shortest or longest

  • 10
  • unavailable
Java games with lists are very popular. This makes sense, since they are all so simple and interesting. Join in the fun! In this task, we create a list of strings. Then we add 10 strings from the keyboard. The most interesting part is that we'll determine whether the shortest string or the longest string is encountered first in the list. If more than one string is shortest or longest, we'll consider the very first one we encounter.
You can't complete this task, because you're not signed in.
Comments(8)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
DincaLevel 10 , Giurgiu
23 October, 16:56
I compiled the code and the answer is correct why it does not pass the test?
RomanLevel 41
24 October, 05:48
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
AlexandrLevel 9 , Boryspil'
11 September, 19:18
Please me help!:) Why does not pass the test???
RomanLevel 41
24 October, 05:47
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at codegym.cc/help.
KIN SOCHEATLevel 19 , Phnom Penh
29 May, 03:27
my code some out correct but the result give wrong. Someone can help please
An GeloLevel 18 , Cebu
18 August 2018, 14:40
Hi can someone give me an example of the output. I'm having a hard time to analyze. thank you :)
RomanLevel 41
20 August 2018, 08:19
For example:
one1
two
three
four
five
six
seven
eight
nine
ten
the longest: three, seven, eight the shortest: two, six, ten You should display "two", because this string occurs earlier in the list from the shortest or the longest strings.
Rakesh KumarLevel 16 , Gambat
28 June, 16:14
Thank you very much, this hint is very useful.