Ad
  • Custom User Avatar

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

  • Custom User Avatar

    How to view my clicked solution(Best Practice, Clever) for my study?

  • Custom User Avatar
  • Custom User Avatar
    v1_per_second = 0.2
    v2_per_second = 0.236111111111111
    

    first test case return [0, 32, 19]
    I want to return [0, 32, 18]

    I think that floating point problem.
    I tried round(v2_per_second, 2) to failed.

    How about in python??

  • Custom User Avatar

    Sorry, I debuged with your source code.
    I realized setdefault is only one saved in dictionary.
    Yes. the other problem is exists.
    Original problem: return first player
    The other problem: return first, second player

    How about?
    In case

    print(winner([c16, c17, c18])) #Rob, Gandalf
    print(winner([c18, c17, c16])) #Gandalf, Rob
    
  • Custom User Avatar

    How about equal player??
    dictionary is not ordered.
    scores is dictionary that not ordered.

  • Custom User Avatar

    Clear!

    "Same" means, here, that the elements in b are the elements in a squared, regardless of the order.

    I forgot this statement. I have a low english skill then I skiped difficult statement.
    I prefer code more than complicated statement.
    Good luck!

  • Custom User Avatar

    function name is wrong

    # wrong
    def gruop_by_commas(n):
    # correct
    def group_by_commas(n):
    

    plz change function name.

  • Custom User Avatar

    You had better think again.
    I had same problem.

    Point

    • Use list range. ex) str_[:i]
  • Custom User Avatar

    How about works this function?
    I'm curious this solution.

    I compared time between you and me.
    you: 100000 loops, best of 3: 9.61 µs per loop
    I : 10000 loops, best of 3: 20.1 µs per loop

  • Custom User Avatar

    Need Features

    1. How about code excute time?
    2. How about code time complexity and space?
    • ex: O(1) or O(n) or O(n log n) or O(n^2)
    1. Need sort time complexity tab

    Thanks.

  • Custom User Avatar

    Why TypeError occurred?

    def prefill(n,v):
        print(n)
        print(v)
        
    should work with n as 0
    Traceback:
       in 
    TypeError: prefill() takes exactly 2 arguments (1 given)
    

    I didn't understand..
    Why didn't into the function?
    I think TestCase is wrong.
    How about your think?

  • Custom User Avatar

    That's beginning from all my fault.

    I would have explained detailed suggesttion.
    Sorry for this accident.

    I think bkaes just translate my opinions to you. but choose unproper words to you. I thknk that didn't insult meaning.

    Back to the fact.

    Fact

    I think confused order

    a = [121, 144, 19, 161, 19, 144, 19, 11] 
    b = [11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19]
    

    I think corrected order

    a = [11, 121, 144, 19, 161, 19, 144, 19] 
    b = [11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19]
    

    How about g964 think?
    I respect whatever Your choose.

  • Custom User Avatar

    I'm sorry for detailed description.
    I wasn't attacked to you. @g964
    Sure, I thank for you. because you used to make the problem with a lot of your valuable time.

    But, I think example needs changed position then people know your purpose quickly.
    Thanks for discussion and answer.

    Confused order

    a = [121, 144, 19, 161, 19, 144, 19, 11] 
    b = [11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19]
    

    I think corrected order

    a = [11, 121, 144, 19, 161, 19, 144, 19] 
    b = [11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19]
    

    and thank you for your translate @bkaes.

  • Custom User Avatar

    Example is consued

    a = [121, 144, 19, 161, 19, 144, 19, 11]
    b = [11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19]

    I understand a[0] == b[0]. because I wasted a lot of my valuable time.
    example needs changed position.

  • Loading more items...