• Sign Up
  • Kata
  • Docs
  • Blog
  • Kumite
  • Forum
  • Leaders
  • Log In
  • Sign Up
Name:Vitaliy
Clan:g0xff
Skills:web gamedev
Member Since:Dec 2019
Last Seen:Apr 2021
Profiles:
    Following:0
    Followers:1
    Allies:0
    View Profile Badges
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (37)
    • Replies
    • Authored
    • Needs Resolution
      • Supergary21
      • commented on "Hands Up" python solution

      I think that n%3 mean that a number divide by 3 and what you want is the remainder. n//3%3 mean that you are diving the number dirst and rounding it down, then you are doinging another division and looking for it's remainder. Same with n//9%3 This just mean that you are dividing by 9 first and rounding down, then you divide by 3 and get the remainder.
      For example;
      5%3 would have a remainder of 2.
      5//3%3 would be 1.66 and round down would have 1, then you find the remainder which is 1.
      12//9%3 would be 1.33 and round down you get 1, then you find the remainder of 1/3 which is 1.

      • dhruvk
      • commented on "Hands Up" python solution

      I mean how you are calculating the exact hands by dividing. I could think of three nested(one for each person ) for loops that gives me array of numbers, but I was failing to stop the 3 nested at exact hands given as input

      • mortonfox
      • commented on "Hands Up" python solution

      In the table given in the kata description, observe that P1, P2, P3 are simply counting in ternary. So this kata is an exercise in converting a decimal integer to ternary.

      • dhruvk
      • commented on "Hands Up" python solution

      Can you please explain this solution

      • Eskay81
      • commented on "Is it a number?" python solution

      What if the string = '0.1' ?

      • rowcased
      • commented on "First Kumite" kumite

      thanks

      • romulusFR
      • commented on "First Kumite" kumite

      Named values are clearer than tuples IMHO : convert[0] ad convert[1], which one is a in a*x + b ?. Actually, NamedTuple would be even better

      • vrabosh
      • commented on "Get the integers between two numbers" python solution

      Here the goal was to show how you can work with lambda and other python chips, so that newcomers learn something new.

      • Typhus
      • commented on "Get the integers between two numbers" python solution

      It is bad practice to assign a lambda to a variable. PEP8 states that its an Anti-Pattern.
      Just declare a normal function if you want to use it more than once.

      See also: https://docs.quantifiedcode.com/python-anti-patterns/correctness/assigning_a_lambda_to_a_variable.html

      • vrabosh
      • commented on "Get the integers between two numbers" python solution

      Why bad practice? If this needs to be done, let's say in the key= or somewhere else like that. Here's an awkward example: arr = [(1,4),(2,3),(1,3)]; sorted(arr, key = lambda e: sum([*range(*e)]))

      • Typhus
      • commented on "Get the integers between two numbers" python solution

      Bad practice, but clever :)

      • Mercy Madmask
      • commented on "Ensure question" python solution

      Yes, so?

      • šŽ’š’€±šŽ’š’€±šŽ’š’€±šŽ’
      • commented on "Ensure question" python solution

      Would this not potentially turn <original_string>?? into <original_string>?

      • Blind4Basics
      • commented on "Status Arrays" python solution

      O(n²)...

      • saniea
      • commented on "Status Arrays" python solution

      nice! I was trying to figure out how to convert my two for loops into list comprehension but couldn't figure out the summation trick.

    • Loading more items...
    • © 2021 Codewars
    • About
    • API
    • Blog
    • Privacy
    • Terms
    • Contact
    • powered by

    Confirm

    • Cancel
    • Confirm