[LeetCode] Taking Maximum Energy From the Mystic Dungeon

1 · · May 12, 2024, 5:40 a.m.
3147. Taking Maximum Energy From the Mystic Dungeon In a mystic dungeon, n magicians are standing in a line. Each magician has an attribute that gives you energy. Some magicians can give you negative energy, which means taking energy from you. You have been cursed in such a way that after absorbing energy from magician i, you will be instantly transported to magician (i + k). This process will be repeated until you reach the magician where (i + k) does not exist. In other words, you will choose...