• 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
xlpy Avatar
Name:Clément L
Clan:Le Wagon
Skills:chess
Member Since:Sep 2020
Last Seen:Jan 2025
Profiles:
Following:551
Followers:549
Allies:547
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (24)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • xlpy
    • created a suggestion for "Pandas Series 104: Flatten Rows From DataFrame" kata
    • 3 years ago

    Admittedly what I'm about to say is a border case and not reporting a bug: I can't help but see a way to have passing functions break, after the following procedure:

    subclass the list class, break it somehow; put an instance of that object in your dataframe and suddenly the function no longer works.
    For example:

    class TrickyList(list):
        def __iter__(self): 
            pass
            
    tl = TrickyList()
    print(isinstance(tl, list)) # True
    tricky_df = pd.DataFrame(data=[[tl,5], [77, 3]], 
                            columns=list('AB'))
    flatten(tricky_df, 'A') # TypeError: iter() returned non-iterator of type 'NoneType'
    

    OK, that was just me having fun with an edge case...

  • Custom User Avatar
    • trashy_incel
    • resolved an issue on "Sum of a Sequence [Hard-Core Version]" kata
    • 3 years ago

    not a kata issue

  • Custom User Avatar
    • xlpy
    • resolved a question on "Pirates and bullions treasure puzzle" kata
    • 3 years ago

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

  • Custom User Avatar
    • 4500zenja1
    • created a question for "Pirates and bullions treasure puzzle" kata
    • 3 years ago

    Let's say we have the following configuration: 100 bullions and 5 pirates. Then we have the following optimal configuration: [98, 0, 1, 0, 1], as it was noted here.

    According to that logic, I think for 30 bullions the right answer is [28, 0, 1, 0, 1], but not the [27, 0, 1, 0, 2]. What am I missing?

  • Custom User Avatar
    • xlpy
    • resolved a question on "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    yeah that's embarassing
    corrected thks

  • Custom User Avatar
    • JohanWiltink
    • created a question for "Pirates and bullions treasure puzzle" kata
    • 5 years ago
    [0,3,1,1,0]
    

    What happens to the other 25 bullions?

  • Custom User Avatar
    • xlpy
    • resolved an issue on "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    done thanks

  • Custom User Avatar
    • xlpy
    • resolved a suggestion on "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    done

  • Custom User Avatar
    • xlpy
    • commented on "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    given that all pirates want as big a share of the treasure as possible, there is a forced equilibrium.
    will make it clearer, thanks for the feedback

  • Custom User Avatar
    • xlpy
    • commented on "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    I think they are to most people indeed, I just have a few weeks only of Python (and any form of code actually
    ) behind me and know decorators for a few hours...

  • Custom User Avatar
    • user9644768
    • created a question for "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    There is an optimal split for this problem assuming all pirates are intelligent and rational, find it!

    What is the criteria of optimality here?

  • Custom User Avatar
    • user9644768
    • created a suggestion for "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    It doesn't seem there is any good reason for using different font sizes and styles, they are merely distracting.

    You can divide the description into sections, if you want.

  • Custom User Avatar
    • hobovsky
    • commented on "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    Is this part really not that clear? Or this example? Or this example?

    I am honestly asking, I thought they are rather clear, but if they are not, they need some improvements.

  • Custom User Avatar
    • rge123
    • created an issue for "Pirates and bullions treasure puzzle" kata
    • 5 years ago

    You should have more than one test!
    You need several static tests covering edge cases and enough random tests to avoid hardcoding.
    See these:
    https://docs.codewars.com/languages/python/authoring/

    You should unpublish before it gets retired 😬

  • Custom User Avatar
    • hobovsky
    • commented on "Kata Beta Process" topic
    • 5 years ago

    Then come to the gitter channel mentioned by @XRFXLP, it should be much easier to explain there.

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...