上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 76 下一页
摘要: Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Example 1: Input: nums = [1, 5, 1, 1, 6, 4] Output: One p 阅读全文
posted @ 2019-11-01 02:15 Schwifty 阅读(104) 评论(0) 推荐(0)
摘要: You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal 阅读全文
posted @ 2019-11-01 01:34 Schwifty 阅读(129) 评论(0) 推荐(0)
摘要: Given two arrays, write a function to compute their intersection. Example 1: Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4] Output: [4,9] Exam 阅读全文
posted @ 2019-10-31 12:13 Schwifty 阅读(136) 评论(0) 推荐(0)
摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2019-10-31 11:11 Schwifty 阅读(169) 评论(0) 推荐(0)
摘要: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2019-10-31 09:38 Schwifty 阅读(130) 评论(0) 推荐(0)
摘要: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2019-10-30 10:36 Schwifty 阅读(143) 评论(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. Example 1: Input: n = 12 O 阅读全文
posted @ 2019-10-30 04:56 Schwifty 阅读(164) 评论(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 @ 2019-10-30 04:09 Schwifty 阅读(146) 评论(0) 推荐(0)
摘要: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k num 阅读全文
posted @ 2019-10-29 11:44 Schwifty 阅读(113) 评论(0) 推荐(0)
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Given linked list -- head = [4,5,1,9], wh 阅读全文
posted @ 2019-10-29 10:41 Schwifty 阅读(127) 评论(0) 推荐(0)
上一页 1 ··· 50 51 52 53 54 55 56 57 58 ··· 76 下一页