• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
Sabre-Sound Avatar
Name:Unknown
Clan:Unknown
Member Since:Sep 2020
Last Seen:Jan 2023
Profiles:
    Following:0
    Followers:0
    Allies:0
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (5)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • Sabre-Sound
      • commented on "Valid Parentheses" python solution
      • 4 years ago

      Nice solution and the single line ifs make it fairly neat/concise. Maybe not best practice though. In if, elif statements - only one is ever called based on the conditions. In yours it looks at both ifs each time. Also, 'open_counter = open_counter + 1' can be reduced to 'open_counter += 1' and likewise, -= 1.

    • Custom User Avatar
      • Floor_manager
      • commented on "Valid Spacing" python solution
      • 5 years ago

      That's a good question

    • Custom User Avatar
      • Sabre-Sound
      • commented on "Valid Spacing" python solution
      • 5 years ago

      Nice, clean solution but what happens if there are 3 or more spaces?

    • Custom User Avatar
      • Sabre-Sound
      • commented on "Valid Spacing" python solution
      • 5 years ago

      imported re for a different method, changed it and different remove import. D'oh

    • Custom User Avatar
      • Sabre-Sound
      • commented on "Decode the Morse code " python solution
      • 5 years ago

      Clever, for sure. Not overly readable for beginners and it doesn't gain any efficiency for being a one-liner.

      Two joins, two for-loops. Using timeit.timeit over 1,000,000 executions, this solution took 13 seconds. Others with one loop took 9 seconds.

      Best to unpack it sometimes.

    • © 2025 Codewars
    • About
    • API
    • Blog
    • Privacy
    • Terms
    • Code of Conduct
    • Contact

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...