Ad
  • Custom User Avatar

    stringname.splitlines()

    So, the way it is presented, maze is the string variable that holds the maze. If you create a list called splitmaze, for example, you could:

    splitmaze = maze.splitlines()

  • Custom User Avatar
  • Custom User Avatar

    On the second one - how about a normal programmer?

    I can define "python programmer" as a programmer who does Python.
    I can't define "normal programmer". Could you explain what or who a "normal programmer" is?

    is there some kind of animosity between us?

    I'm sure I haven't said anything offensive to you...

    You seem to be going out of your way to correct me and not being overly polite about it

    In my previous comment I have stated that you're incorrect about "multiple dict look-ups" and stated my opinion about [::-1] and reversed(). If you think I was correcting you, then I can't help in any way ¯\_(ツ)_/¯

  • Custom User Avatar

    multiple dictionary lookups, faster and cleaner to define and reuse a variable

    Wrong, it's code repetition (dict[c]), not multiple dictionary lookups.

    [::-1] less obvious (albeit faster) than reversed()

    A Python programmer always knows what [::-1] means, moreover it's safer because it always returns a structure, not an iterator which may need to be additionally converted to list.

  • Custom User Avatar

    Yes, both the solution and reference run for 4.5 sec resulting in 9 sec altogether.

  • Default User Avatar

    @monobrawl: If you're talking about my message in the discourse, I talked about that algo. But the annonced time was earlier in the history of the kata, with less demanding tests. It behaves the same as your solution. Myjinxin's one is a bit faster.

  • Custom User Avatar

    I think you forget do divide this time by 2, because 50% of the time is user's solution and other 50% of the time is the reference solution.