摘要:
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters. Example 1: Input: "eceba" Output: 3 Explana 阅读全文
摘要:
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
摘要:
Given a collection of distinct integers, return all possible permutations. 题意: 打印全排列 Solution1: Backtracking 形式化的表示递归过程:permutations(nums[0...n-1]) = 阅读全文
摘要:
Given a sorted integer array nums, where the range of elements are in the inclusive range [lower, upper], return its missing ranges. Example: 题意: 给定一个 阅读全文
摘要:
Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Example 2: 题意: 给定一个数组,统计其中元素的区间分布。 思路: scan给定数组 若当前数字 = 阅读全文