原创 [LeetCode] 223. Rectangle Area

Problem Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom

原创 [LeetCode] 442. Find All Duplicates in an Array

Problem Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.

原创 [LeetCode] 937. Reorder Log Files

Problem You have an array of logs. Each log is a space delimited string of words. For each log, the first word in each

原创 [LeetCode] 328. Odd Even Linked List

Problem Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are tal

原创 [LeetCode] 84. Largest Rectangle in Histogram

Problem Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the

原创 [LeetCode] 287. Find the Duplicate Number

Problem Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at l

原创 [LeetCode] 165. Compare Version Numbers

Problem Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return

原创 [LeetCode] 545. Boundary of Binary Tree

Problem Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary

原创 [LeetCode] 605. Can Place Flowers

Problem Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cann

原创 [LeetCode] 867. Transpose Matrix

Problem Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it's main diag

原创 [LeetCode] 876. Middle of the Linked List

Problem Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two

原创 [LeetCode] 475. Heaters

Problem Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to war

原创 [LeetCode] 617. Merge Two Binary Trees

Problem Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees

原创 [LeetCode] 905. Sort Array By Parity

Problem Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by

原创 [LeetCode] 709. To Lower Case

Problem Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Exam