摘要:
题目: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order r 阅读全文
摘要:
题目: Follow up for "Remove Duplicates":What if duplicates are allowed at most twice? For example,Given sorted array nums = [1,1,1,2,2,3], Your function 阅读全文
摘要:
题目: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). W 阅读全文
摘要:
题目: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3 阅读全文
摘要:
题目: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. For example,Given 阅读全文
摘要:
题目: Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. For example, given the follo 阅读全文
摘要:
题目: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the 阅读全文
摘要:
题目: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve 阅读全文
摘要:
题目: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible represen 阅读全文
摘要:
题目: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size 阅读全文