摘要: Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled 阅读全文
posted @ 2017-03-15 12:43 CodesKiller 阅读(143) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2017-03-15 07:37 CodesKiller 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(85) 评论(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 阅读(201) 评论(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 阅读(130) 评论(0) 推荐(0) 编辑