在上次打劫完一条街道之后,窃贼又发现了一个新的可以打劫的地方,但这次所有的房子围成了一个圈,这就意味着第一间房子和最后一间房子是挨着的。每个房子都存放着特定金额的钱。你面临的唯一约束条件是:相邻的房子装着相互联系的防盗系统,且 当相邻的两个房子同一天被打劫时,该系统会自动报警。 给定一个非负整数列表 ...
分类:
其他好文 时间:
2018-04-15 22:59:53
阅读次数:
207
We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra ...
分类:
其他好文 时间:
2018-04-15 20:57:27
阅读次数:
171
【题意概述】 找两个字符串的最长不公共子串。 【题目分析】 两个字符串的最长不公共子串就应该是其中一个字符串本身,那么判断两个字符串是否相等,如果相等,那么肯定没有公共子串,输出“-1”.否则就是两个字符串中长的最长的长度。 【AC】 ...
分类:
其他好文 时间:
2018-04-15 18:45:53
阅读次数:
151
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2: Inp ...
分类:
其他好文 时间:
2018-04-15 16:26:08
阅读次数:
130
Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in th ...
分类:
其他好文 时间:
2018-04-14 16:27:43
阅读次数:
133
给定一个字符串数组words,找到length(word[i]) * length(word[j])的最大值,并且两个单词不含公共的字母。你可以认为每个单词只包含小写字母。如果不存在这样的两个单词,返回 0。示例 1:输入 ["abcw", "baz", "foo", "bar", "xtfn", ...
分类:
其他好文 时间:
2018-04-14 16:22:31
阅读次数:
138
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complet ...
分类:
其他好文 时间:
2018-04-14 13:47:05
阅读次数:
792
1· 【 html中自适应设置】:meta和script <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" /> 【和 ...
分类:
其他好文 时间:
2018-04-13 22:31:23
阅读次数:
159
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t ...
分类:
其他好文 时间:
2018-04-13 16:22:41
阅读次数:
186
We estimate the maximum prediction accuracy for the risk of Alzheimer's disease based on disease prevalence and heritability of liability. We demonstr ...
分类:
其他好文 时间:
2018-04-12 22:34:19
阅读次数:
193