
LeetCode
文章平均质量分 64
喜欢Sunshine
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
2.Add Two Numbers
题目2: 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原创 2018-01-15 10:34:27 · 166 阅读 · 0 评论 -
1.Two sum
c++中string可以通过string.length()来获得string的长度,当对与一个数组来说就不是这么容易了。 如一个int型的数组: int a[] = {1,2,3,5,6,9};如何获得呢? 可以通过sizeof的特殊用法,都知道sizeof()是获得所占的空间的大小,所以可以:int length = sizeof(a)/sizeof(int);来得到a数组的元素个数。原创 2018-01-08 10:19:07 · 180 阅读 · 0 评论 -
3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which the length is 3.Given “bbbbb”, the answer is “b”, with the le转载 2018-01-17 09:39:16 · 126 阅读 · 0 评论 -
最大子列和问题
实例1.1 最大子列和问题(20 分)给定K个整数组成的序列{ N1 , N2 , …, NK},“连续子列”被定义为{ Ni , Ni+1 , …, Nj },其1≤i≤j≤K。“最大子列和”则被定义为所有连续子列元素的和中最大者。例如给定序列{ -2, 11, -4, 13, -5, -2 },其连续子列{ 11, -4, 13 }有最大的和20。现要求你编写程序,计算给原创 2018-03-05 11:04:09 · 159 阅读 · 0 评论 -
剑指offer 十三题 在O(1)时间删除链表结点
#include<iostream>#include<stdlib.h>using namespace std;struct ListNode{ int m_nValue; ListNode *m_pNext; ListNode(int n){ m_nValue = n; m_pNext = NULL; } };void DeleteNode(ListN...转载 2018-05-25 11:03:54 · 126 阅读 · 0 评论 -
在字符串中查找子串
#include<iostream>#include<stdlib.h>using namespace std;class Solution{public: char *strFind(char * string, char *substring) { if (string == NULL &&substring == NULL) ...原创 2018-07-10 16:06:27 · 18068 阅读 · 1 评论