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.
- Prepare
- Algorithms
- Strings
- Gemstones
- Discussions
Gemstones
Gemstones
Sort by
recency
|
1047 Discussions
|
Please Login in order to post a comment
Here is a O(n+m) time and O(1) space solution in python.
O(n+m) is the average of the worse case scenarion, where all 26 chars will be present in every string. This means in the worse case the time will be O(Ch*n).
C# solution:
Here is problem solution in python java c++ c and javascript - https://programmingoneonone.com/hackerrank-gemstones-problem-solution.html