摘要: Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2020-01-12 11:26 xuan_abc 阅读(164) 评论(0) 推荐(0)
摘要: Given an array A of integers and integer K, return the maximum S such that there exists i < j with A[i] + A[j] = S and S < K. If no i, j exist satisfy 阅读全文
posted @ 2020-01-12 10:33 xuan_abc 阅读(175) 评论(0) 推荐(0)
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example 1: Input: [[1,1],[2,2],[3,3]] Output: 3 Ex 阅读全文
posted @ 2020-01-12 07:50 xuan_abc 阅读(149) 评论(0) 推荐(0)
摘要: Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new Solution(nu 阅读全文
posted @ 2020-01-12 03:59 xuan_abc 阅读(98) 评论(0) 推荐(0)
摘要: Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number m 阅读全文
posted @ 2020-01-12 03:38 xuan_abc 阅读(171) 评论(0) 推荐(0)