![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Stack
Nahida_nora
这个作者很懒,什么都没留下…
展开
-
Leetcode 316 去除重复字母
Leetcode 316 去除重复字母尽可能确保字符串重的字符单调递增。确保字符串没有重复字符使用栈结构:不完全是单调栈。class Solution {public: string removeDuplicateLetters(string s) { vector<int> visited(26), nums(26); for(char ss : s){ nums[ss - 'a']++; }原创 2020-12-20 14:45:28 · 61 阅读 · 0 评论 -
Leetcode 60. Permutation Sequence
Leetcode 60. Permutation SequenceWhy Do We Need Factorial Number SystemUsually standard decimal or binary positional system could meet our needs. For example, each subset could be described by a number in binary representation.相似的问题class Solution { p原创 2020-06-16 05:12:48 · 80 阅读 · 0 评论 -
Leetcode 1257. Smallest Common Region
Leetcode 1257. Smallest Common RegionBuild family tree from offsprings to their parents;Use a HashSet to construct ancestry history of region1;Retrieve ancestry of region2 by family tree till find the first common ancestry in ancestry history of region1原创 2020-06-10 00:33:57 · 122 阅读 · 0 评论 -
Leetcode 1124. Longest Well-Performing Interval
Leetcode 1124. Longest Well-Performing IntervalWe starts with a score = 0,If the working hour > 8, we plus 1 point.Otherwise we minus 1 point.We want find the maximum interval that have strict positive score.After one day of work, if we find the to原创 2020-06-08 08:23:31 · 152 阅读 · 0 评论