题目描述: 分析:先建一个数组s用来存储每个字符串的长度,然后遍历数组s得到最大的数max,这个数就是词典中的最长单词的长度,由于可能有多个长度相等的单词,所以要循环整个词典,当一个单词的长度等于max时,就将它存到要返回的ArrayList中。 我的代码: ...
分类:
其他好文 时间:
2017-11-18 21:00:18
阅读次数:
170
public class Solution { /* * @param triangle: a list of lists of integers * @return: An integer, minimum path sum */ public int minimumTotal(int[][] t... ...
分类:
其他好文 时间:
2017-11-13 19:48:05
阅读次数:
123
题目: 给定一个字符串source和一个目标字符串target,在字符串source中找到包括所有目标字符串字母的子串。 注意事项 如果在source中没有这样的子串,返回"",如果有多个这样的子串,返回起始位置最小的子串。 给定一个字符串source和一个目标字符串target,在字符串sourc ...
分类:
编程语言 时间:
2017-11-13 14:01:49
阅读次数:
330
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target va ...
分类:
其他好文 时间:
2017-11-13 11:35:15
阅读次数:
162
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or ...
分类:
其他好文 时间:
2017-11-12 14:10:46
阅读次数:
145
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. Given a binary tree, find the maximum path sum. Th ...
分类:
其他好文 时间:
2017-11-12 12:33:03
阅读次数:
161
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. ...
分类:
其他好文 时间:
2017-11-12 12:23:38
阅读次数:
135
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. Bonus point if you are ab ...
分类:
其他好文 时间:
2017-11-12 12:22:13
阅读次数:
128
Determine the number of bits required to flip if you want to convert integer n to integer m. Both n and m are 32-bit integers. Determine the number of ...
分类:
其他好文 时间:
2017-11-12 11:18:51
阅读次数:
141
Given n nodes in a graph labeled from 1 to n. There is no edges in the graph at beginning. You need to support the following method: 1. connect(a, b), ...
分类:
其他好文 时间:
2017-11-12 11:18:15
阅读次数:
216