Ad
  • Custom User Avatar

    I faced the same issue as well. I liked my original solution, but due to the expected usage of maketrans, I modified the solution to pass through the tests.

  • Custom User Avatar

    I submitted, the tests passed. I removed some print statements, submitted and then tests failed. I kept hitting submit until eventually a scenario came up that accepted my code and now it's been accepted. I still have no idea why my code works (or doesn't work). I'm pretty sure I followed the Kata rules and accommodated for scenarios that came up in the tests.

    I've caught a lot of cases in the random tests that have expectations that go against the rules of the Kata description as well. I pointed one out that I flagged as an issue.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The only way I was able to get my tests to pass was to round to 4 decimal places:

    round(num, 4)
    
  • Custom User Avatar

    Seems like accommodating for that space at the end passes all the tests. Just wondering if it is intentional or not.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I think this Kata is more suited for a 7kyu. Basic understnading of dictionaries and loops.

    This Kata is pretty much a small part of this kata:
    http://www.codewars.com/kata/character-frequency-1

    With that kata being a 6kyu, I don't think it merits being in the same difficulty level.

  • Custom User Avatar

    This just seems a little too easy. Maybe try adding some difficulty to it so individuals learn more out of it.

    For example, try adding something like this as a test case:

    a = 99
    b = beers on a wall
    should return -> "99 beers on a wall"