leetcode
文章平均质量分 54
ray_kong
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Valid parentheses
Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of brackets.Open brackets must be closed in the correct order原创 2023-04-09 19:05:19 · 298 阅读 · 0 评论 -
longest Common Prefix
1、选取字符串中的一个元素(第一个元素)为基准,遍历基准的字符,并与字符串中的其他元素的相应位置比较。时间复杂度为O(nlogm)。2、按照字典序(ascii码)对字符串进行排序,然后寻找最大值和最小值的公共前缀。原创 2023-04-09 15:30:12 · 242 阅读 · 0 评论 -
Roman to integer
Answer 2. C++:用switch-case or if- else if分成7种情况。Answer 1. 可以使用python的字典来存储7个罗马字符,然后遍历字符串。原创 2023-04-09 13:55:24 · 239 阅读 · 0 评论
分享