Ad
  • Custom User Avatar

    Your explanation here would be a good start: "you need to count how many possible ways to get at least one Letter with Head/Tail (from the input string)". I see six of the phrase you emphasised throughout the question Letter with Head/Tail in the result. "Total Possible Amount" is not defined well.

  • Custom User Avatar

    Another incomprehensible puzzle. I count 6 'total amount' whatever that means as two different things are being explained and a third is being shown.

  • Custom User Avatar

    That is really silly then. This should be on mathwars.com, not codewars.com.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Took me a minute to understand the question, but the test values helped. The values are:

    • n - number of eggs available
    • m - number of drops possible (any more would cause his heart to break)

    So for example if the values were n = 1, m = 100, the answer would be 100. Just start dropping
    your one egg at floor 1 and continue up until it either breaks or you run out of tries. So you can
    give the exact number for any floor up to 100. The actual floor might be 2000, but you can only verify up
    to 100 with one egg. If you start on any other number, for example floor 2, the egg might break. Then
    you know that floor 2 isn't safe, but you aren't sure if floor 1 is safe or not, so you can't
    give a correct answer.