Find All Anagrams in a String

preview_player
Показать описание
Name: Find All Anagrams in a String
Category of Data Structure: Arrays and Strings
Category of Technique: Order-Independent Character Counter of a String
Difficulty: Medium

Complexity Analysis of the Answer:

1. Order-Independent Character Counter of a String

Time complexity O(len(s)+len(p)), as we use two independent for-loop to traverse through s and p
Space complexity O(1), as the two counters have fixed lengths, while ignoring result array length

Рекомендации по теме