Probably not the most optimal solution but passed:
Complexity
Time: (TODO: Not sure, but probably is the case since there’re nested loops)
Space: because dictionary size is fixed since there is limited set of characters
Search
May 17, 20241 min read
Probably not the most optimal solution but passed:
Time: O(n2) (TODO: Not sure, but probably is the case since there’re nested loops)
Space: O(1) because dictionary size is fixed since there is limited set of characters