parameters: (self, nextVisit)
return_statement: return dp[-1]
docstring: :type nextVisit: List[int]
          :rtype: int
docstring_summary: :type nextVisit: List[int]
          :rtype: int
docstring_tokens: : type nextVisit : List [ int ] : rtype : int
function: def firstDayBeenInAllRooms(self, nextVisit):
          """
          :type nextVisit: List[int]
          :rtype: int
          """
          MOD = 10**9+7
  
          dp = [0]*len(nextVisit)
          for i in xrange(1, len(dp)):
              dp[i] = (dp[i-1]+1+(dp[i-1]-dp[nextVisit[i-1]])+1)%MOD
          return dp[-1]
function_tokens: def firstDayBeenInAllRooms ( self , nextVisit ) : MOD = 10 ** 9 + 7 dp = [ 0 ] * len ( nextVisit ) for i in xrange ( 1 , len ( dp ) ) : dp [ i ] = ( dp [ i - 1 ] + 1 + ( dp [ i - 1 ] - dp [ nextVisit [ i - 1 ] ] ) + 1 ) % MOD return dp [ - 1 ]