Ad
  • Custom User Avatar

    Yes, you are right. Thank you for your comment.

    I'm late, now it's just rant:)

  • Custom User Avatar

    "Classic" implementation with Math.sqrt() is faster and, as YangF0917 mentioned,

    there will be still a marginal chance that the code fails to identify whether the number is prime or composite

  • Custom User Avatar

    Written below refers to the variant of the kata in Java.

    The method which supposed to return YES or NO obviously should return boolean, not String.

    And the name should be at least tickets, not Tickets, 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.

  • Custom User Avatar

    "? true : false" is redundant, because the result of "i % 2 == 0" is boolean.