Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
No chromosome is written like this, X comes first then Y.
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.
time is not scary only to the Egyptian pyramids)))
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.
The following moves give a final score of 9: [1, 5, 2, 1].
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
Try to play the game on a piece of paper and try different strategies and try to find the best one.
I don't understand this.
12 is an even number so why is only 1 cards taken first?
12,11,10,5,4,2,1
alice -9
bob -3
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
It doesn't really matter what's the name of the dictionary to return, you just need to return it.
Clever move
least larger
Least means smallest; larger means bigger.
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
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
oruppercase only
based on:If needed I could edit the description to like that. To make it more clearly.
Loading more items...