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.
Genius!
Rejected because of missing random tests. You still can fix this by forking this translation.
Approved by someone
In case of positive result why we are performing this operation health-damage multiple times
solution will be improved if you add "i < (arr1.length < arr2.length? arr2.length : arr1.length);" to for loop, that way if one array is longer, it will consider the longer one's length ,
chad
Nice function, took it
"Given a number n, return the
number of positive odd numbers
below n, EASY!"And is correct that way because inputs "... are always lowercase strings, and that each has at least two letters.". If that was not the case and arbitrary inputs would be allowed we'd also need checks for
null
and lengths in order to avoidNullPointerException
andIndexOutOfBoundsException
or alike.it work only if cases are equal
I would rather have more spaces to increase the readability of the code, but it's okay
Thank you a lot for the explanation and providing this article, I'l read more about OOP for sure
It's not like it's better to use "static". You use static keyword when you want to call method or variable without creating class instantiation. In this example I just want to call method so I skipped creation of new Kata object. I suggest you read some about object oriented programmin, you will fully understand purpose of this keyword ๐ Anyway there is cool article about "static" keyword:
https://www.baeldung.com/java-static
is it better practice to have static keyword in it?
I did it using a DFA and it was wayyy longer. How do you get it to be this short?
Loading more items...