Ad
  • Custom User Avatar

    They should include in the description:
    "brackets must be closed in the order they were opened"
    Otherwise, test case #4 " "[(])" => False" is valid

  • Custom User Avatar

    I am working on this one right now and came to the same conclusion. According to the answer in the unit test, it would seem that this particular output in incorrect. From reading the other outputs I inferred that the sorting should be by length and then lexicographically, this output (that user Arazai pointed out) seems to be incorrect based on that assumption.
    Please consider making more precise instructions.

  • Custom User Avatar

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

  • Custom User Avatar

    I got a brute force solution to work: getting all the permutations possible for the given input and then using a regex to test each and every single one of them. It is not very efficient and won't pass the test within the given time allowed by the test server.

    Any suggestions on approaches that would be less expensive than brute force ?

  • Custom User Avatar

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

  • Custom User Avatar

    I was able to pass all the tests with a Python3 Solution, but still got an error message :

    Traceback (most recent call last):
    File "main.py", line 16, in
    Test.assert_equals(FileNameExtractor.extract_file_name(s),ex,"It should work for random inputs too")
    File "/home/codewarrior/solution.py", line 15, in extract_file_name
    return query.group(2) + query.group(3)[:-1]
    AttributeError: 'NoneType' object has no attribute 'group'

    This would seem to indicate that the re expression is getting no matches, but yet it works find in my IDE.

  • Custom User Avatar

    I just did this kata and had a similar solution to those posted(though longer and uglier). It only works for 4 digit prices though. When I ran my solution I came across a bunch of prices with 5 or 3 digits, which messed up my whole algorithm . It was not clear to me that there would be prices of varying length (which make the re pattern more complex and this kata way harder)

  • Custom User Avatar

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

  • Custom User Avatar

    I just ran the test again with the same code and the input [[1, 1], [3, 1], [4, 1]], which in my IDE gets me the expected output ([[1, 1], [3, 1], [4, 1]]) but the grader
    does not get the same result. The other test cases also work fine in my IDE and the web-tester, but this particular input makes it brainfart. I think there might be a little gremlin inside this program messing with the outputs

  • Custom User Avatar

    I wrote a solution in python3 that works in my IDE for any test case I can think of and the web-tester says it passes, but the final upload says it fails and gives me a screwy error message:

    [[1, 1], [3, 1], [4, 1]] should equal [[1, 1], [3, 1], [4, 1], [5, 1]]

    How the hell is the solution supposed to have an extra pair of num/denom not even in the input?

  • Custom User Avatar

    "Check to see if a supplied string has the same NUMBER of 'x's and 'o's, but case is irrelevant. Each string may contain any type of character. Your solution must return a boolean."
    FTFY

    If it can be counted , it is not an amount.