Ad
  • Custom User Avatar

    "Idk why my solution is not working" is not an issue.

  • Custom User Avatar

    It is about the way you're creating OrderedDict's.

    OrderedDict is a dictionary where keys maintain the order in which they are inserted.
    That means, you have to create OrderedDict, by giving it keys in the order you want them to stay.
    Try to use for loop to do this.

    When you solve this, rest of your code should be working with Python 2.7.6.
    No Issue in this case.

    Godspeed mate!

  • Default User Avatar

    I would suggest trying to go about another approach. Wrong or right (obviously it is wrong) this code would not fare well in an interview due to readability and being overly complex. Keep up the effort :)

  • Custom User Avatar

    Print the input and you'll see what cases you're failing.

  • Custom User Avatar

    Attempt the kata instead of trying the sample tests.

  • Custom User Avatar

    Sample tests in Python are broken.

  • Default User Avatar

    Got error.... what it has to do with my code?

    Traceback (most recent call last):
      File "main.py", line 3, in <module>
        test.expect(validBraces( "()" ), True);
      File "/runner/frameworks/python/cw-2.py", line 22, in expect
        display('FAILED', message)
      File "/runner/frameworks/python/cw-2.py", line 14, in display
        type.upper(), mode.upper(), label, format_message(message)))
      File "/runner/frameworks/python/cw-2.py", line 9, in format_message
        return message.replace("\n", "<:LF:>")
    AttributeError: 'bool' object has no attribute 'replace'
    
  • Default User Avatar
  • Custom User Avatar

    First is there in case there is more than one string (or consecutive strings) with the same length.

  • Default User Avatar

    By sying first isnt it supposed to be the first appear on list compare to to one before? :x
    The word 'first' should be removed from the instructions ...

  • Custom User Avatar

    What are you talking about? "oocccffuucccjjjkkkjyyyeehh" is the longest string.

  • Default User Avatar

    ['ejjjjmmtthh', 'zxxuueeg', 'aanlljrrrxx', 'dqqqaaabbb', 'oocccffuucccjjjkkkjyyyeehh'], 1

    expected: oocccffuucccjjjkkkjyyyeehh
    result: ejjjjmmtthh

    why isn't ejjjjmmtthh the first longest string in the array?
    its longer than zxxuueeg ... and its after him (k=1).

  • Default User Avatar
  • Custom User Avatar

    The user doesn't exist anymore ¯\_(ツ)_/¯

  • Custom User Avatar

    Your solution is wrong.

  • Loading more items...