03 2017 档案

摘要:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 标签 Hash Table Math 类似题目 (M) Line Reflection 标签 Has 阅读全文
posted @ 2017-03-25 15:48 Deribs4 阅读(161) 评论(0) 推荐(0)
摘要:Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the  阅读全文
posted @ 2017-03-25 13:36 Deribs4 阅读(122) 评论(0) 推荐(0)
摘要:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2017-03-25 13:13 Deribs4 阅读(142) 评论(0) 推荐(0)
摘要:Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and 阅读全文
posted @ 2017-03-24 14:22 Deribs4 阅读(679) 评论(0) 推荐(0)
摘要:Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Note: There are at 阅读全文
posted @ 2017-03-23 23:06 Deribs4 阅读(451) 评论(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-23 16:40 Deribs4 阅读(1139) 评论(0) 推荐(0)
摘要:Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2017-03-22 21:51 Deribs4 阅读(190) 评论(0) 推荐(0)
摘要:The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order,We get the following sequence 阅读全文
posted @ 2017-03-22 21:51 Deribs4 阅读(177) 评论(0) 推荐(0)
摘要:Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to 阅读全文
posted @ 2017-03-22 21:50 Deribs4 阅读(242) 评论(0) 推荐(0)
摘要:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
posted @ 2017-03-20 20:03 Deribs4 阅读(129) 评论(0) 推荐(0)
摘要:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpo 阅读全文
posted @ 2017-03-20 15:48 Deribs4 阅读(159) 评论(0) 推荐(0)