1. Two Sum 2. Add Two Numbers 3. Longest Substring Without Repeating Characters ...
分类:
其他好文 时间:
2019-10-07 00:43:53
阅读次数:
77
1 typedef long long ll; 2 typedef pair<int,int> P; 3 #define _for(i,a,b) for(register int i = (a);i < b;i ++) 4 #define _rep(i,a,b) for(register int i... ...
分类:
其他好文 时间:
2019-10-06 15:10:43
阅读次数:
74
滑动窗口思想: 如对于abcabcab,无重复字符的最长字串为abc,长度为3。使用滑动窗口思想,当窗口为abc时,再进入a,队列变为abca,不满足要求,需要移动窗口。移动的方法为抛弃最左边的字符,即a,持续该操作,直到序列末尾。 注:unordered_set用来判断只去重不重复的需求(set是 ...
分类:
其他好文 时间:
2019-10-05 00:59:01
阅读次数:
87
题目描述 Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The an ...
分类:
其他好文 时间:
2019-10-03 17:47:38
阅读次数:
75
题目链接:https://leetcode.com/problems/longest-continuous-increasing-subsequence/description/ ...
分类:
其他好文 时间:
2019-10-02 16:18:41
阅读次数:
91
Difficulty: Hard More:【目录】LeetCode Java实现 Description Given a string containing just the characters '(' and ')', find the length of the longest valid ...
分类:
其他好文 时间:
2019-09-28 23:13:49
阅读次数:
116
git log HEAD~1..HEAD --author="$(git config --get user.name)" --pretty=tformat: --numstat | awk '{ add += $1 ; subs += $2 ; loc += $1 + $2 } END { pri ...
分类:
其他好文 时间:
2019-09-28 14:53:36
阅读次数:
108
Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Note: There may be more than one LIS combination, it ...
分类:
其他好文 时间:
2019-09-28 11:16:10
阅读次数:
106
:ets.new(table_name, pattern) 第一个参数是表名,第二个参数是表的设置选项。 :set 一个key,一个数据,无序 :ordered_set 一个key,一个数据,有序; 1 == 1.0 :bag 一个key,多个数据, 不可重复 :duplicate_bag 一个ke ...
分类:
其他好文 时间:
2019-09-25 12:54:41
阅读次数:
127
题目: 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 题解: i j 分别记录目标字符串的左右边界。对当前字符 x,如果前面出现过,则更新左边界为上次出现位置的下一个,然后更新当前字符 x 的位置,遍历过程中记录一下 j - i + 1的最大值就好了。 ...
分类:
其他好文 时间:
2019-09-19 09:15:42
阅读次数:
50