Ad
  • Custom User Avatar
  • Custom User Avatar

    Fixed by fork above.

  • Custom User Avatar

    Fork approved.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Well, if it's end-inclusive then for input 11 shouldn't it result in 3 instead of 2 since 11 + 2 is also prime?

    Anyway, the description is still unclear imo.

  • Custom User Avatar

    Your mission, should you choose to accept it, is to write a function that counts the number of sets of twin primes from 1 to n.

    It was not mentioned that the range is end-exclusive.

  • Custom User Avatar
    1. The random tests are not random.
    2. Formula in the description can be misunderstood by how it is written, it may be read as one of these:
      3 * sqrt(3 * a^2 / 2)
      3 * sqrt(3 * a^2) / 2
      3 * sqrt(3) * a^2 / 2
      3 * sqrt((3 * a)^2) / 2
      3 * sqrt((3 * a)^2 / 2)
      
  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Finally done this kata! A hard one it was to accomplish. Kinda disappointed that this kata indeed goes towards micro-optimization and I had to spam attempt to pass. Nonetheless, it was refreshing to complete this after getting frustrated with other math katas. Thanks for the kata.

  • Custom User Avatar

    Better version of my previous solution :)

    • Uses string in all places instead of doing multiple conversion (from string to tuple then tuple to string)
    • Actually implement what is suggested in the description so that the sum doesn't done twice to get the carrier
    • Looks nice in Codewars solution formatter
    • No use of any type
  • Custom User Avatar

    Yes, but then again it's not a good experience for a kata that (based on current ranking votes) would be 7kyu to scroll through the output horizontally and search for the placement of each new-lines and bar chars when they can just show it normally.

  • Custom User Avatar

    Sample tests should use strictEqual.

  • Custom User Avatar
    1. Set chai.config.truncateThreshold to 0 or false so that user can see fully the expected result.
    2. The example output in description would be better if it's actually written as to how it will be shown in log:
    h █████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 9%
    e █████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 9%
    l ███████████████████████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 27%
    o ██████████████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 18%
      █████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 9%
    w █████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 9%
    r █████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 9%
    d █████████☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐☐ 9%
    
  • Loading more items...