摘要: Peeking Iterator (M) 题目 Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the 阅读全文
posted @ 2020-06-23 03:17 墨云黑 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Move Zeroes (E) 题目 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero element 阅读全文
posted @ 2020-06-22 05:39 墨云黑 阅读(82) 评论(0) 推荐(0) 编辑
摘要: Reverse Nodes in k-Group (H) 题目 Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive inte 阅读全文
posted @ 2020-06-22 03:45 墨云黑 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Swap Nodes in Pairs (M) 题目 Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes, 阅读全文
posted @ 2020-06-22 02:56 墨云黑 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Merge k Sorted Lists (H) 题目 Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4- 阅读全文
posted @ 2020-06-22 02:23 墨云黑 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Generate Parentheses (M) 题目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given 阅读全文
posted @ 2020-06-22 01:20 墨云黑 阅读(62) 评论(0) 推荐(0) 编辑
摘要: Perfect Squares (M) 题目 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Exa 阅读全文
posted @ 2020-06-21 07:42 墨云黑 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Merge Two Sorted Lists (E) 题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of 阅读全文
posted @ 2020-06-21 06:07 墨云黑 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Valid Parentheses (E) 题目 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An inp 阅读全文
posted @ 2020-06-21 05:52 墨云黑 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Remove Nth Node From End of List (M) 题目 Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list 阅读全文
posted @ 2020-06-21 05:27 墨云黑 阅读(134) 评论(0) 推荐(0) 编辑