摘要:
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 transaction 阅读全文
摘要:
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 poswhich represents the posit 阅读全文
摘要:
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 阅读全文
摘要:
Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 解法一:遍历(我的 阅读全文
摘要:
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. 阅读全文
摘要:
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文
摘要:
Given an array nums of n integers, are there elements a, b, c in numssuch that a + b + c = 0? Find all unique triplets in the array which gives the su 阅读全文
摘要:
Given a collection of intervals, merge all overlapping intervals. Example 1: Example 2: 第一次用java自带的“List” 这个数据结构,好多用法还不清楚,尤其是sort这个自带的排序方法.... 阅读全文
摘要:
Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another array, yo 阅读全文
摘要:
Convert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1. Example 1: Input: 123 Output: " 阅读全文