Ad
  • Custom User Avatar

    No chromosome is written like this, X comes first then Y.

  • Custom User Avatar

    nah using global inside function is more confusing than just using uppercase for constants and you can use them without declaring global in all functions.

  • Custom User Avatar

    time is not scary only to the Egyptian pyramids)))

  • Custom User Avatar

    The aim is to have the most cards at the end. Not take the most of them each turn.
    Sometimes it's better to just take one.

  • Default User Avatar

    The following moves give a final score of 9: [1, 5, 2, 1].

  • Custom User Avatar

    I'm trying to figure out n = 12 and this is how to get 9 and 3

    n = 12
    Alice Turn: Alice = 1, Bob = 0, Remain = 12 - 1= 11
    Bob Turn: Alice = 1, Bob = 1, Remain = 12 - 2 = 10
    Alice Turn: Alice = 5 + 1 = 6, Bob = 1, Remain = 12 - 7 = 5
    Bob Turn: Alice = 6, Bob = 1 + 1 = 2, Remain = 12 - 8 = 4
    Alice Turn: Alice = 6 + 1 = 7, Bob = 2, Remain = 12 - 9 = 3
    Bob Turn: Alice = 8, Bob = 2 + 1 = 3, Remain = 1
    Alice Turn: Alice = 8 + 1 = 9, Bob = 3, Remain = 0

  • Default User Avatar

    Try to play the game on a piece of paper and try different strategies and try to find the best one.

  • Custom User Avatar

    I don't understand this.
    12 is an even number so why is only 1 cards taken first?

  • Custom User Avatar

    12,11,10,5,4,2,1

    alice -9
    bob -3

  • Default User Avatar

    How should I know how many cards bob will take?

    if the number of cards is even, the players can either take half of the cards from the stack, or only 1 card -- as they choose;

    According to: The aim of the game is to collect the most cards.

    This test is wrong: test.assert_equals(card_game(100000000000), 99999999950)

    Because after first round:
    Alice should take: 50000000000 and Bob should take: 25000000000 cards....

    And if the answer is: 99999999950 -> means that Bob took only 50 cards at all

  • Custom User Avatar

    It doesn't really matter what's the name of the dictionary to return, you just need to return it.

  • Custom User Avatar
  • Custom User Avatar

    .. the least largest is ..

    least larger

    Least means smallest; larger means bigger.

  • Custom User Avatar

    Description is not great, but let me try

    you will get an array of numbers and an index, you have to return the index of least larger number than the number at given index, for example

    ( [4, 1, 3, 5, 6], 0 )

    4 is the number at given index which is 0

    so what numbers are greater than 4 (5 and 6)

    but the least largest is 5 (so return the index of 5 which is 3)

    if you don't have any numbers greater than the number at the given index return -1

  • Default User Avatar

    In this Kata, you will be given a string that may have mixed uppercase and lowercase letters and your task is to convert that string to either lowercase only or uppercase only based on:

    • make as few changes as possible.
    • if the string contains equal number of uppercase and lowercase letters, convert the string to lowercase.

    If needed I could edit the description to like that. To make it more clearly.

  • Loading more items...