摘要:
题目描述: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 a 阅读全文
摘要:
题目描述: The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the tot 阅读全文
摘要:
题目描述: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the fart 阅读全文
摘要:
题目描述: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may 阅读全文
摘要:
题目描述: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one trans 阅读全文
摘要:
题目描述: 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 阅读全文
摘要:
题目描述: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents th 阅读全文
摘要:
题目描述: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, w 阅读全文
摘要:
题目描述: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - G 阅读全文