We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

gabrielaramburu • 2 months ago

There is a problem with the import of package, this work for me;

import java.util.stream.Collectors;

BassamElKhoury • 7 months ago

Am I the only one who can't run his code? I tried to run it on safari and chrome but the editor is stuck on "waiting" on both browsers

[CG]Thibaud • 7 months ago

there was an issue with our infrastructure this weekend. It should be running smoothly now

masxa • 7 months ago

I did Generics! Yaaay :) :)

ChrisBamberry • 9 months ago

Is this still accurate on codingame.com? I can't see the link to the GitHub...??

Luc Chauvet • 9 months ago
Ashutosh Sharma • 11 months ago

It would be better if you can add some basic example to explain the problem.
The questions say we have to find the total number of letters in all the names with more than 5 letters

Example:
List = {"orange", "apple", "watermelon", "melonbar", "monkeybar"}

the count of the words having letters more than 5 is four in the list i.e. orange, watermelon, melonbar, monkeybar.

OR

"the total number of letter in all the names with more than 5 letters" - will be total of the letters which exceeds 5 in all the names
e.g.
letters exceeding 5 in all string
orange = 2
apple = 0
watermelon = 5
melonbar = 3
monkeybar = 4

total = 2+0+5+3+4 = 14

Can you explain what exactly the question is about?

Samuel Tan • 10 months ago

I think the question is to first filter out all the words that exceed 5 letters, then sum up the lengths of all such words.
In your above case, only the following names exceed 5 letters:
orange (length: 6)
watermelon (length: 10)
melonbar (length: 8)
monkeybar (length: 9)
So the final result will be: 6 + 10 + 8 + 9 = 33
This is a solution:
return Arrays.stream(names).filter(s -> s.length() > 5).mapToInt(s -> s.length()).sum();

Anonymous • 2 years ago

Très très intéressant comme entrainement .merci