[TLE] Should give the code more time when using Python?

  • 0

    I don't know how to improve it. May be I should change my algorithm.

    def anagrams(self, strs):
        sorted_strs = []
        result = []
        for s in strs:
        for i, s in enumerate(sorted_strs):
            if sorted_strs.count(s) > 1:
        return result

Log in to reply

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