原创 LeetCode 67. Add Binary

Description Given two binary strings, return their sum (also a binary string). For example, a = "11" b ="1"

原创 LeetCode 367. Valid Perfect Square

Description Given a positive integer num, write a function which returns True if num is a perfect square else Fal

原创 LeetCode 485. Max Consecutive Ones

Description Given a binary array, find the maximum number of consecutive 1s in this array. Example: Input: [1,1,0,

原创 LeetCode 342. Power of Four

Description Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example: Give

原创 LeetCode 223. Rectangle Area

Description Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by i

原创 LeetCode 500. Keyboard Row

Description Given a List of words, return the words that can be typed using letters of alphabet on only one row’s o

原创 LeetCode 122. Best Time to Buy and Sell Stock II

Description Say you have an array for which the ith element is the price of a given stock on day i . Design an alg

原创 LeetCode 20. Valid Parentheses

Description Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input s

原创 LeetCode 492. Construct the Rectangle

Description For a web developer, it is very important to know how to design a web page’s size. So, given a specific

原创 LeetCode 374. Guess Number Higher or Lower

Description We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess

原创 LeetCode 101. Symmetric Tree

Description Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). Analysis 最直接

原创 LeetCode 14. Longest Common Prefix

Description Write a function to find the longest common prefix string amongst an array of strings. Code class Solution

原创 LeetCode 643. Maximum Average Subarray I

Description Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximu

原创 LeetCode 100. Same Tree

Description Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered

原创 LeetCode 73. Set Matrix Zeroes

Description Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow up: D