• 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
sebastianhatt Avatar
Name:Unknown
Clan:Unknown
Member Since:May 2020
Last Seen:Jul 2021
Profiles:
    Following:1
    Followers:1
    Allies:1
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (15)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • csimpilimpi
      • commented on "Simple Fun #132: Number Of Carries" python solution
      • 4 months ago

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

    • Custom User Avatar
      • Chrono79
      • commented on "Simple Fun #132: Number Of Carries" python solution
      • 5 years ago

      Please use spoiler flag next time.

    • Custom User Avatar
      • sebastianhatt
      • commented on "Simple Fun #132: Number Of Carries" python solution
      • 5 years ago

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

    • Custom User Avatar
      • slb416
      • commented on "Histogram data" python solution
      • 5 years ago

      Thank you! I never knew about this. Much appreciated.

    • Custom User Avatar
      • sebastianhatt
      • commented on "Histogram data" python solution
      • 5 years ago

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

    • Custom User Avatar
      • sebastianhatt
      • commented on "String Letter Counting" python solution
      • 5 years ago

      Simple and intuitive. O(n²) though, so it's slow for long strings. I would replace i.islower() with i.isalpha() for more readable code.

    • Custom User Avatar
      • sebastianhatt
      • commented on "String Letter Counting" python solution
      • 5 years ago

      Well, islower() returns False if isalpha() is False, so islower() is actually used to check if the character is alphabetical, since all the alphabetical characters are already lower case, so it will only be False for only non-alphabetical characters. It's not wrong, but it would be more logical and readable if isalpha() was used instead.

    • Custom User Avatar
      • rezaj
      • commented on "Smallest unused ID" python solution
      • 5 years ago

      Yeah probably should've done that looking back - thanks for the help! Think I just assumed at the time that the numbers would all be small because it was an 8 kyu problem...

    • Custom User Avatar
      • sebastianhatt
      • commented on "Largest pair sum in array" python solution
      • 5 years ago

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

    • Custom User Avatar
      • sebastianhatt
      • commented on "Smallest unused ID" python solution
      • 5 years ago

      You may want to use:

      range(len(arr))
      

      The current code always tests every number from 0 to 999, even if the list has only 5 elements. It also can't find the smallest unused ID if it's bigger than 999.

    • Custom User Avatar
      • sebastianhatt
      • commented on "Smallest unused ID" python solution
      • 5 years ago

      How can you know that the smallest unused ID isn't 1000? Or some other number bigger than 999? The code only checks numbers up to 999. Try using:

      range(len(arr))
      
    • Custom User Avatar
      • sebastianhatt
      • commented on "Smallest unused ID" python solution
      • 5 years ago

      Yes, it is very slow, O(n²), and one should use a different solution for bigger lists, eg. using a set/hash table. However, there is no solution with O(log n). You need to look through all items in the list, so you will always have at least O(n). Solutions using sorting (eg. quicksort) or building hash tables will probably have O(n log n) at least.

    • Custom User Avatar
      • anter69
      • commented on "Fouriest transformation" python solution
      • 5 years ago

      Thanks for the tip ;-)

    • Custom User Avatar
      • sebastianhatt
      • commented on "Fouriest transformation" python solution
      • 5 years ago

      Nice solution. Notice that you can use

        4*while i >= base**(max_fours):
      

      instead of

        while i >= base**(max_fours):
      

      Then the loop will only need to run 1/4 as many times :)

    • Custom User Avatar
      • sebastianhatt
      • commented on "N-Parasitic Numbers Ending in N" python solution
      • 5 years ago

      This doesn't actually calculate the answers though.

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

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...