摘要: We are given head, the head node of a linked list containing unique integer values. We are also given the list G, a subset of the values in the linked 阅读全文
posted @ 2018-08-15 20:44 回到明天 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middl 阅读全文
posted @ 2018-08-15 11:09 回到明天 阅读(83) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. Example: Input: 1->2->6->3->4->5->6, val = 6 Output: 1->2->3->4->5 Remove all 阅读全文
posted @ 2018-07-25 20:53 回到明天 阅读(93) 评论(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 @ 2018-07-25 20:35 回到明天 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list. Examp 阅读全文
posted @ 2018-07-25 20:20 回到明天 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Implement a trie with insert, search, and startsWith methods. Example: Trie trie = new Trie(); trie.insert("apple"); trie.search("apple"); // returns 阅读全文
posted @ 2018-07-14 21:37 回到明天 阅读(108) 评论(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 @ 2018-07-12 19:50 回到明天 阅读(138) 评论(0) 推荐(0) 编辑
摘要: A sorted list A contains 1, plus some number of primes. Then, for every p < q in the list, we consider the fraction p/q. What is the K-th smallest fra 阅读全文
posted @ 2018-07-11 21:22 回到明天 阅读(71) 评论(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 @ 2018-07-05 09:20 回到明天 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. Note: You may assum 阅读全文
posted @ 2018-07-05 04:53 回到明天 阅读(90) 评论(0) 推荐(0) 编辑