找出所有方案 排列和组合问题 排列: https://www.lintcode.com/problem/combination-sum/description 1 public class Solution { 2 /** 3 * @param candidates: A list of integ ...
分类:
其他好文 时间:
2019-02-07 09:31:58
阅读次数:
125
说到数字的统计,小时候的数学课大家都应该有学过,但数字太多太复杂的,手动肯定耗时间不说还很容易出错。所以今天分享一下如何用程序来完成。 Have you met this question in a real interview? 你是否在真实的采访中遇到过这个问题? Count the numbe ...
分类:
编程语言 时间:
2019-01-29 18:19:03
阅读次数:
191
#单词拆分II#给一字串s和单词的字典dict,在字串中增加空格来构建一个句子,并且所有单词都来自字典。#返回所有有可能的句子。#EXAMPLE:#给一字串lintcode,字典为["de", "ding", "co", "code", "lint"]#结果为["lint code", "lint ...
分类:
其他好文 时间:
2019-01-24 13:31:03
阅读次数:
111
public class Solution { / @param nums: An integer array @return: The length of LIS (longest increasing subsequence) / public int longestIncreasingSubs ...
分类:
其他好文 时间:
2019-01-16 13:18:18
阅读次数:
185
``` Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your m... ...
分类:
其他好文 时间:
2019-01-16 13:13:05
阅读次数:
146
/** * 给定一个链表,旋转链表,将链表每个节点向右移动 k 个位置,其中 k 是非负数。 示例 1: 输入: 1->2->3->4->5->NULL, k = 2 输出: 4->5->1->2->3->NULL 解释: 向右旋转 1 步: 5->1->2->3->4->NULL 向右旋转 2 步 ...
分类:
其他好文 时间:
2019-01-11 15:57:39
阅读次数:
240
/** * Lock by Leetcode * 369. Plus One Linked List * https://www.lintcode.com/problem/plus-one-linked-list/description * * Given a non-negative intege ...
分类:
其他好文 时间:
2019-01-01 12:27:05
阅读次数:
240
描述 给定一个链表,判断它是否有环。 样例 给出 -21->10->4->5, tail connects to node index 1,返回 true。 这里解释下,题目的意思,在英文原题中,tail connects to node index 1 表示的是节点 5 还要链接回索引号 为 1 ...
分类:
其他好文 时间:
2018-12-16 14:41:38
阅读次数:
127
描述 给一个01矩阵,求不同的岛屿的个数。 0代表海,1代表岛,如果两个1相邻,那么这两个1属于同一个岛。我们只考虑上下左右为相邻。 样例 在矩阵: [ [1, 1, 0, 0, 0], [0, 1, 0, 0, 1], [0, 0, 0, 1, 1], [0, 0, 0, 0, 0], [0, 0 ...
分类:
其他好文 时间:
2018-12-16 14:39:07
阅读次数:
162
Implement a trie with insert, search, and startsWith methods. Notice You may assume that all inputs are consist of lowercase letters a-z. Implement a ...
分类:
其他好文 时间:
2018-12-15 10:27:01
阅读次数:
134