Why [[100]] should return 1 for the dungeon game?

  • 0

    Is it should be 0 since first gird is 1 and there is no need to have point at the beginning?

  • 0

    No the knight's HP has to be at least 1 at any time. If the knight's HP is 0 at the beginning, it means the knight is dead before entering the dungeon.

  • 0

    because there is a sentence "The knight has an initial health point represented by a positive integer", so the initial HP has to be at least 1.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.