We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Here is a solution in python with O(n + m) time and O(m) space.
The space is in part because althogh the set cat grow as large as 26, values can be access at O(1) and the queries are the values that we search for in the set at a time of O(m) and equel space.
Weighted Uniform Strings
You are viewing a single comment's thread. Return to all comments →
Here is a solution in python with O(n + m) time and O(m) space.
The space is in part because althogh the set cat grow as large as 26, values can be access at O(1) and the queries are the values that we search for in the set at a time of O(m) and equel space.