![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
爱宝宝的菜鸟
这个作者很懒,什么都没留下…
展开
-
3.Leetcode Longest Substring Without Repeating Characters
题目 Given a string, find the length of the longest substring without repeating characters. Example 1: Input: “abcabcbb” Output: 3 Explanation: The answer is “abc”, with the length of 3. 解题方法 借助unordere...原创 2019-04-12 11:02:36 · 107 阅读 · 0 评论 -
2.LeetCode Add Two Numbers
题目: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and ret...原创 2019-04-09 22:03:57 · 76 阅读 · 0 评论 -
1.Leetcode1 Two Sum
题目:Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the sam...原创 2019-04-08 22:10:59 · 101 阅读 · 0 评论 -
字符串的排列(牛客)
## 标题字符串的排列 1.题目 :输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。 2.解题思路: 3.程序实现: class Solution { public: vector<string> Permutation(string str) { ...原创 2019-09-13 10:49:52 · 251 阅读 · 0 评论 -
构建乘积数组 (from牛客)
构建乘积数组 题目:给定一个数组A[0,1,…,n-1],请构建一个数组B[0,1,…,n-1],其中B中的元素B[i]=A[0]A[1]…*A[i-1]A[i+1]…*A[n-1]。不能使用除法。 解题思路:先算下三角中的连乘,即我们先算出B[i]中的一部分,然后倒过来按上三角中的分布规律,把另一部分也乘进去。 代码: class Solution { public: vector&l...原创 2019-09-14 14:01:09 · 136 阅读 · 0 评论