![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
Dxy17
welcome:future
展开
-
Leetcode(page1)_easy
目录1.Two Sum(两个数求和)7.Reverse Integer(倒序整数)13. Roman to Integer(罗马数字转换为整数)14. Longest Common Prefix(公共最长前缀)20. Valid Parentheses(有效的括号)21. Merge Two Sorted Lists(合并两个有序的list)26. Remov...原创 2019-05-19 16:35:26 · 170 阅读 · 0 评论 -
Task4:LeetCode1:twoSum; LeetCode344:Reverse String;LeetCode151:Reverse Words in a String
1.Two Sum(两个数求和)class Solution: def twoSum(self, nums: 'List[int]', target: int) -> 'List[int]': dicti = {} for i, n in enumerate(nums): if n in dicti: ...原创 2019-05-19 22:33:06 · 94 阅读 · 0 评论 -
leetcode46 permutations
此题是求的数字全排列可以借助于C++中的#<algorithm>中的next_permutation(计算下一个的全排列)#include<iostream>#include<vector>#include<algorithm>using namespace std;vector<vector<int>> ...原创 2019-09-02 20:49:05 · 118 阅读 · 0 评论 -
LeetCode47 Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.此题和上一道46的差别在于此题中给出的有重复的数字因为next_permutation求解的是下一个全排列,因此不会出现重复的现象#include<iostream>...原创 2019-09-02 21:10:45 · 133 阅读 · 0 评论 -
leetcode48. Rotate Image
You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the imagein-place, which means you have to modify the input 2D matrix d...原创 2019-09-02 21:58:37 · 93 阅读 · 0 评论