上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 98 下一页
摘要: Design a data structure that supports all following operations in average O(1) time. insert(val): Inserts an item val to the set if not already presen 阅读全文
posted @ 2018-11-15 21:44 Veritas_des_Liberty 阅读(245) 评论(0) 推荐(0)
摘要: Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the u 阅读全文
posted @ 2018-11-15 21:03 Veritas_des_Liberty 阅读(196) 评论(0) 推荐(0)
摘要: Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input 阅读全文
posted @ 2018-11-15 15:13 Veritas_des_Liberty 阅读(256) 评论(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 @ 2018-11-15 14:37 Veritas_des_Liberty 阅读(252) 评论(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 @ 2018-11-14 22:39 Veritas_des_Liberty 阅读(224) 评论(0) 推荐(0)
摘要: Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runti 阅读全文
posted @ 2018-11-14 21:56 Veritas_des_Liberty 阅读(256) 评论(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 @ 2018-11-14 21:23 Veritas_des_Liberty 阅读(260) 评论(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 @ 2018-11-14 19:53 Veritas_des_Liberty 阅读(296) 评论(0) 推荐(0)
摘要: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2018-11-14 16:39 Veritas_des_Liberty 阅读(205) 评论(0) 推荐(0)
摘要: Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Example 1: Example 2: my code: can't determine the 阅读全文
posted @ 2018-11-13 22:31 Veritas_des_Liberty 阅读(192) 评论(0) 推荐(0)
上一页 1 ··· 55 56 57 58 59 60 61 62 63 ··· 98 下一页