Python one line solution ←_←


  • 0
    X
    class Solution(object):
        def deserialize(self, s):
            """
            :type s: str
            :rtype: NestedInteger
            """
            return NestedInteger(eval(s))
    

    Just use eval, but i know it is not the purpose of the problem though is works correctly.


Log in to reply
 

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