• 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
lazypython Avatar
Name:Unknown
Clan:Unknown
Skills:math, python, machine learning, data structures, c
Member Since:Oct 2016
Last Seen:Feb 2022
Profiles:
Following:313
Followers:324
Allies:306
View Profile Badges
Ad
Would You Pass the Google SQL Interview? Test Yourself with These 7 Concepts
Study up for your next SQL interview with these interview questions.
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (17)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • Voile
    • resolved an issue on "String incrementer" kata
    • 7 years ago

    Not an issue

  • Custom User Avatar
    • lazypython
    • commented on "Opposite number" python solution
    • 8 years ago

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

  • Custom User Avatar
    • raulbc777
    • commented on "Score From Permutations Of Combinations of an Integer" kata
    • 8 years ago

    Check it now and let me know. I don't know what I was thinking about one year ago. :)

  • Custom User Avatar
    • raulbc777
    • commented on "Score From Permutations Of Combinations of an Integer" kata
    • 8 years ago

    I'll fix it as soon as possible. Thanks @bouchert for the observation. Thanks @kazk for your answer.

  • Custom User Avatar
    • kazk
    • commented on "Score From Permutations Of Combinations of an Integer" kata
    • 8 years ago

    I didn't realize this when approving. I agree this is an issue and would like to resolve this.
    I'm able to edit this kata, but the test looks super confusing. I don't know the purpose of the following:

    import itertools
    from itertools import combinations # ?
    from itertools import permutations # ?
    
    def permutations(iter_):
        return itertools.permutations(iter_)
    
    def combinations(iter_, i):
        return itertools.combinations(iter_, i)
    

    Also, if this shadowing of permutations is not done on purpose (to disable second parameter), I don't know why it's there.
    I can't think of any explanation for combinations.
    Am I missing something? (I don't know how Python's modules work.)

    Maybe we need to wait for @raulbc777.

  • Custom User Avatar
    • bouchert
    • commented on "Score From Permutations Of Combinations of an Integer" kata
    • 8 years ago

    It's not entirely clear what your problem is, since you don't say anything about what errors or problems you're experiencing. However, it's possible you're running into the subject of my complaint above. You can't do from itertools import permutations for now. The test declares its own, less flexible version of permutations that overrides it, and which doesn't accept a second parameter. For now, you can work around it by calling import itertools and then using the fully-qualified itertools.permutations function.

  • Custom User Avatar
    • bouchert
    • created an issue for "Score From Permutations Of Combinations of an Integer" kata
    • 8 years ago

    For the Python test cases, your decision to define a function named permutations that only takes one argument causes a conflict with anyone who does a from itertools import permutations and then makes the otherwise entirely valid function call permutations(a,k) return a confusing error about permutations only expecting one parameter. Even though you could just alter your implementation of permutations to accept an additional argument, generally speaking, you should try to avoid collisions with importable functions and user solutions' choices for their variable names. Please try to use as few global variables and functions as possible, and use long, uniquely non-obvious names and/or store them inside of a single variable or class.

  • Custom User Avatar
    • smile67
    • commented on "Score From Permutations Of Combinations of an Integer" kata
    • 8 years ago

    It's up to 9 digits, so your code is too slow to pass the final testcases;-)...

  • Custom User Avatar
    • lazypython
    • created a question for "Score From Permutations Of Combinations of an Integer" kata
    • 8 years ago

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

  • Custom User Avatar
    • GiacomoSorbi
    • commented on "Simple Fun #87: Shuffled Array" kata
    • 8 years ago

    It was already translated by suic, regrettably Y_Y

  • Custom User Avatar
    • myjinxin2015
    • commented on "Simple Fun #87: Shuffled Array" kata
    • 8 years ago

    At the moment CW is very slow.
    Approved. Where is your Python? ;-)

  • Custom User Avatar
    • myjinxin2015
    • resolved an issue on "Simple Fun #87: Shuffled Array" kata
    • 8 years ago

    OK, thanks for your feedback ;-)

  • Custom User Avatar
    • lazypython
    • commented on "Simple Fun #87: Shuffled Array" kata
    • 8 years ago

    Well, I was wrong. There can't be two solutions.

    Sum of combinations may be equal to the elements in the shuffled array but it's not necessarily the left out element. I have now completed the Kata too.

    Thanks! It was really fun.

  • Custom User Avatar
    • GiacomoSorbi
    • commented on "Simple Fun #87: Shuffled Array" kata
    • 8 years ago

    Ruby and Crystal solutions dished. Tschuss!

  • Custom User Avatar
    • GiacomoSorbi
    • commented on "Simple Fun #87: Shuffled Array" kata
    • 8 years ago

    Can you make a concrete example? As I don't see any chance of getting two different numbers as viable solutions, but I might be short-sighted.

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

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...