Repeated DNA Sequences All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for examp…
分类:LeetCode
【leetcode】97. Interleaving String 字符串c是否是字符串a、b的交叉结果
1. 题目 Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = …
LeetCode | Scramble String(字符交换)
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings re…
LeetCode算法题-Maximum Product of Three Numbers(Java实现)
这是悦乐书的第275次更新,第291篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第143题(顺位题号是628)。给定一个整数数组,从其中找出三个数,使得乘积最大。例如: 输入:[1,2,3…
2018-06-30 3. Longest Substring Without Repeating Characters
题意:给你一个字符串,找到里面不包含相同字符的最长子串。 解题思路: 思路一:暴力,(loop1)从第一个字符开始,(loop2)字符数量从1到n,(loop3)判断每个子串是否符合条件。时间复杂度为O(n * n * …
57. Insert Interval
57. Insert Interval 题目 Given a set of non-overlapping intervals, insert a new interval into the intervals (mer…
39. Combination Sum
39. Combination Sum 题目 Given a set of candidate numbers (C) (without duplicates) and a target number (T), find…
[LeetCode] Construct Binary Tree from Preorder and Inorder Traversal 由先序和中序遍历建立二叉树
Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that dup…
[LeetCode] Largest Sum of Averages 最大的平均数之和
We partition a row of numbers A into at most K adjacent (non-empty) groups, then ou…
LeetCode 6. ZigZag Conversion
The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (y…
Leetcode 208. Implement Trie (Prefix Tree)
Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist…
LeetCode | Count and Say
题目: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1…