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.
can anyone please explain how it work??
The absolute value of positive numbers and zero is that number itself, and the C++ compilers automaticly convert -0 to 0.
Same solution as mine, except you don't need to split the string since you can just iterate over a string using a for or a for of loop.
-0 is not exist, the program understand -0 or +0 as 0;
Really nice!
Накой строку преобразовывать в массив если ее и так можно перебрать?
because count is an object. the ternary operation is checkin if the property (key: value) is in the count object already. if yes, it adds 1 to the stored value, if not it sets/adds the property.
so if string = 'example', the first run is going to see that count is empty, so count['e'] doesn't exist, and it will set count[e] = 1. then you have count = {e: 1}.
Can someone explain to me how the characters are ending up in the 'count' variable in this solution? I understand that it works, I'm not quite getting how.
Awesome !!
Mind blown !! Excellent !
thats so docking clever
clever, I had same solution but did n * -1 instead of just -n. Good idea
i think he doesnt talk about his comments, he means that his solution isnt the shortest and could be better
nice!!
for..of loop, you mean - a for..in loop on a string will iterate over the indeces; a for..of loop will iterate over the characters.
Loading more items...