Ad
  • Default User Avatar

    It's no bad thing to import modules if they get the job done! There's a time and a place for code golf. That said - with the distance of several years' hindsight - I should probably have added a short comment.

  • Custom User Avatar

    Really nice! I saw someone else use a for-loop with an xor operator (i.e. "^") which is similar and doesn't need an import. I like this the best because it is O(n) and it is very clean. It's a bit more arcane than the simplest solution, but for large values of N this is definitely the right approach.

    Good work :)

  • Custom User Avatar

    [1].same_structure_as([[1]]) returns true but should be false.