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.
Yes, you are right. Thank you for your comment.
I'm late, now it's just rant:)
"Classic" implementation with
Math.sqrt()
is faster and, as YangF0917 mentioned,Written below refers to the variant of the kata in Java.
The method which supposed to return YES or NO obviously should return
boolean
, notString
.And the name should be at least
tickets
, notTickets
, according to the Java method naming convention.But even
tickets
is bad name, because it tells nothing about what this method is supposed to do.Something with signature like
public static boolean isPossibleToSellTicketsToTheEntireLine(int[] billsInTheLine)
would be much better."? true : false" is redundant, because the result of "i % 2 == 0" is boolean.