摘要:
https://leetcode.cn/problems/longest-common-prefix/ 难度:简单 自己的思路:先找到字符串数组中的最短的那个(可能不止一个,随便选择一个),以最短字符串的索引为基础进行遍历,内存循环遍历字符串数组。 自己的写法: class Solution: de 阅读全文
摘要:
https://leetcode.cn/problems/roman-to-integer/ 难度:简单 题目说: I 可以放在 V (5) 和 X (10) 的左边,来表示 4 和 9。 X 可以放在 L (50) 和 C (100) 的左边,来表示 40 和 90。 C 可以放在 D (500) 阅读全文
摘要:
https://leetcode.cn/problems/two-sum/ 难度:简单 自己的解法(很慢): class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: result=[] for i in 阅读全文