Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
10K++ people passed. You should opt for an O(N) approach, O(N^2) with more than 1 loop iteration may time out.
Unfortunately,
652
is not a perfect square (sqrt(652) ≈ 25.5342907), whereas625
is (625 = 25 * 25). The correct answer to return here is625
.Your code fails to take into account when only the first letter of the word is in lowercase & the rest is uppercase:
tBAWJUB
becomesTBAWJUB
=> Technically not an acronym, but first letter of the first word of a sentence should be uppercased.yes
As you iterate through your list (
text
here),you are conditionally removing elements from the list.
This will result in unpredictable behaviour.
If removal is necessary, iterate over a copy of the list
or use techniques such as iterating backwards
to avoid index shifting issues.