Slowest Python solution - -!


  • 0
        def getPermutation(self, n, k):
            plist = itertools.permutations([str(i) for i in range(1, n+1)])
            for i in range(k-1):
                plist.next()
            return ''.join(plist.next())

Log in to reply
 

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