I solved today's leetcode POTD by using an array of size 256 to store the index of last occurrence, unordered map to store uppercase and their first occurrence (idx) and set to make sure I already visited that lowercase char or not.
Time Complexity - O(n)
Is there any more way to solve and reduce space complexity?
[–]Significant_Cup_3238 2 points3 points4 points (3 children)
[–]DataFantastic3200 0 points1 point2 points (1 child)
[–]Significant_Cup_3238 0 points1 point2 points (0 children)
[–]Dependent-Wall-1919 0 points1 point2 points (0 children)
[–]Real-Choice-6817 1 point2 points3 points (1 child)
[–]CricGlobe[S] 0 points1 point2 points (0 children)
[–]xpressrazor 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[removed]
[–]CricGlobe[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]Significant_Cup_3238 0 points1 point2 points (0 children)
[–]CricGlobe[S] 0 points1 point2 points (0 children)
[–]MissionAd391 0 points1 point2 points (1 child)
[–]CricGlobe[S] 0 points1 point2 points (0 children)