上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页
摘要: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals 阅读全文
posted @ 2017-03-15 06:02 CodesKiller 阅读(82) 评论(0) 推荐(0) 编辑
摘要: Given n points on a 2D plane, find if there is such a line parallel to y-axis that reflect the given points. Example 1: Given points = [[1,1],[-1,1]], 阅读全文
posted @ 2017-03-15 02:39 CodesKiller 阅读(199) 评论(0) 推荐(0) 编辑
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 本题是比较难的题目,首先需要弄懂一点,就是最大公约数是最大的可整除数,也就是默认为k值(y=kx+b 阅读全文
posted @ 2017-03-15 02:17 CodesKiller 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, 阅读全文
posted @ 2017-03-15 01:24 CodesKiller 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2017-03-13 03:24 CodesKiller 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Description: Count the number of prime numbers less than a non-negative number, n. 本题不知道为什么,不可以使用hashtable来做,如果用了就超时了,只能用数组来存储,代码如下: 阅读全文
posted @ 2017-03-13 01:55 CodesKiller 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For exa 阅读全文
posted @ 2017-03-13 01:32 CodesKiller 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2017-03-12 09:41 CodesKiller 阅读(148) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
posted @ 2017-03-12 08:01 CodesKiller 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte 阅读全文
posted @ 2017-03-08 03:47 CodesKiller 阅读(417) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页