• 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
Jeodic Avatar
Name:Wojciech Hernat
Clan:Unknown
Member Since:Nov 2022
Last Seen:Jan 2025
Profiles:
Following:0
Followers:0
Allies:0
View Profile Badges
Ad
How many Kata did you complete in 2024?
Discover our top moments in 2024 and how you can level up in 2025.
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (24)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • Grecks
    • commented on "Strip Comments" python solution
    • 14 months ago

    It's perfectly fine to iterate over the characters of a line looking for the first comment marker. It's even much more efficient in terms of runtime, see my other comment! And it can be beautiful too, have a look at my solution.

  • Custom User Avatar
    • The INFP Coder
    • commented on "Unique In Order" python solution
    • 2 years ago

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

  • Custom User Avatar
    • The INFP Coder
    • commented on "Unique In Order" python solution
    • 2 years ago

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

  • Custom User Avatar
    • Jeodic
    • commented on "Ones and Zeros" python solution
    • 2 years ago

    there are better, simpler oneliners

  • Custom User Avatar
    • mlkaizenquest
    • commented on "Memoized Fibonacci" python solution
    • 2 years ago

    Hi, actually, function 1 is called when python interpret the line that contain @function1. So it call it like this: function1(function2). This is redefining the function2 to what function1 returns.
    If function1 return function2, later calls to function2 will indeed execute the code of function 2.

    In the case of this solution, as memoized function is returning the wrapped function, later calls to fibonacci actually will call wrapped function (that has inside it the original fibonacci function).

    So, when the interpreter reads the line "@memoized", it calls the memoized function (like this memoized(fibonnacci) ). Then it creates the empty dictionary and return the wrapper function. This way the dictionary is not redefined to empty at every call to fibonacci function.
    The dictionary is still saved at the memory and the wrapper function has a reference to it.
    Later call to fibonacci function will indeed call the wrapper function because the memoized functoin redefined it to wrapper function.

  • Custom User Avatar
    • Alex Sky
    • commented on "Unique In Order" python solution
    • 3 years ago

    Interesting idea! Probably should be more efficient)

  • Custom User Avatar
    • Jeodic
    • commented on "Sort binary tree by levels" python solution
    • 3 years ago

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

  • Custom User Avatar
    • Jeodic
    • commented on "Codewars style ranking system" python solution
    • 3 years ago

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

  • Custom User Avatar
    • Jeodic
    • commented on "Rot13" python solution
    • 3 years ago

    Epic almost-one-liner

  • Custom User Avatar
    • Jeodic
    • commented on "Rot13" python solution
    • 3 years ago

    Dang you were bored. :D

  • Custom User Avatar
    • Jeodic
    • commented on "lechevalier's Python solution for "Next smaller number with the same digits"" kumite
    • 3 years ago

    A lesson in elegance! Those traversings look really nice to me as a beginner. And thanks for the readable example, I failed this kata and learned a lot from this.

  • Custom User Avatar
    • Jeodic
    • commented on "Array.diff" python solution
    • 3 years ago

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

  • Custom User Avatar
    • Jeodic
    • commented on "My smallest code interpreter (aka Brainf**k)" python solution
    • 3 years ago

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

  • Custom User Avatar
    • Jeodic
    • commented on "Strip Comments" python solution
    • 3 years ago

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

  • Custom User Avatar
    • Jeodic
    • commented on "Memoized Fibonacci" python solution
    • 3 years ago

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

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...