Longest Substring Without Repeating Characters 找无相同字符的最长子串,o(n)暴力判断即可 16. 3Sum Closest 对于给定整数,在给定数组中寻找三个数的和,使得这个和最接近这个整数 显然二分即可 14. Longest Common Pre ...
分类:
其他好文 时间:
2017-04-03 11:33:17
阅读次数:
170
<script> //数据验证参数配置 $.validator.setDefaults({ highlight: function (e) { $(e).closest(".form-group").removeClass("has-success").addClass("has-error") } ...
分类:
其他好文 时间:
2017-03-31 16:48:23
阅读次数:
207
jquery向上查找父元素 用到的方法:closest() parents() parent() closest() 方法获得匹配选择器的第一个祖先元素 [*]parent()函数是只往父级找一层;[*]parents()函数是往父级找多层,一直找到body标签。 向下查找子元素 用到的方法:fin ...
分类:
Web程序 时间:
2017-03-23 11:30:42
阅读次数:
177
//图片预览 HUIDENG.imgShow = function(){ $(".img_show").each(function(){ var tar = $(this); var img = tar.closest("li").find(".img"); var windowURL = wind ...
分类:
Web程序 时间:
2017-03-22 23:14:23
阅读次数:
173
Give n points on 2-D plane, find the K closest points to origin 1 package fbPractise; 2 3 import java.util.*; 4 5 class Coordinate { 6 int x; 7 int y;... ...
分类:
其他好文 时间:
2017-03-14 10:24:58
阅读次数:
238
思路:先对vector进行排序,然后夹逼计算,时间复杂度O(n^2),里面需要注意在判断完边界后,先计算thres和result,然后处理下标,这里不需要考虑重复情况。 ...
分类:
其他好文 时间:
2017-03-11 23:49:27
阅读次数:
181
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. ...
分类:
编程语言 时间:
2017-03-05 20:35:29
阅读次数:
159
The Closest M Points 【问题描述】 软工学院的课程很讨厌!ZLC同志遇到了一个头疼的问题:在K维空间里面有许多的点,对于某些给定的点,ZLC需要找到和它最近的m个点。 (这里的距离指的是欧几里得距离:D(p, q) = D(q, p) = sqrt((q1 - p1) ^ 2 + ...
分类:
其他好文 时间:
2017-02-25 18:23:17
阅读次数:
224
Given a target number and an integer array A sorted in ascending order, find the index i in A such that A[i] is closest to the given target.Return -1 ... ...
分类:
其他好文 时间:
2017-02-12 14:35:28
阅读次数:
149
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. ...
分类:
其他好文 时间:
2017-01-28 07:17:10
阅读次数:
182