Python dp-solution
dp[i] means we reach room i at dp[i] days.\nIn order to reach room i+1, we need to reach room i twice - even times.\nThe first time is from room 0 to room i, wh
dp[i] means we reach room `i` at `dp[i]` days.\nIn order to reach room `i+1`, we need to reach room `i` **twice** - even times.\nThe first time is from room `0` to room `i`, while the second is from room `nextV[i]` to room `i`\nAdditionally, there are 2 cost day - one for moving from room `i` to room `nextV[i]` and another for moving from room `i` to room `i+1`\n```\ndef firstDayBeenInAllRooms(self, nextV: List[int]) -> int:\n\tdp, mod = [0]*(len(nextV)), 10**9+7\n\tfor i in range(len(nextV)-1):\n\t\tdp[i+1] = (dp[i]*2-dp[nextV[i]]+2)%mod\n\treturn dp[-1]\n```
[]