Problem You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 …
分类:LeetCode
LeetCode刷题之Climbing Stairs
Problem You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 …
LeetCode刷题之Length of Last Word
Problem Given a string s consists of upper/lower-case alphabets and empty space characters ‘ ‘, re…
LeetCode刷题之Sqrt
Problem Implement int sqrt(int x). Compute and return the square root of x. My Solution class Solution { publi…
LeetCode刷题之Search Insert Position
Problem Given a sorted array and a target value, return the index if the target is found. If not, return the i…
LeetCode刷题之Maximum Subarray
Problem Find the contiguous subarray within an array (containing at least one number) which has the largest su…
LeetCode刷题之Remove Element
Problem Do not allocate extra space for another array, you must do this in place with constant memory. The ord…
LeetCode刷题之Remove Duplicates from Sorted Array
Problem Given a sorted array, remove the duplicates in place such that each element appear only once and retur…
LeetCode刷题之Merge Two Sorted Lists
Problem Merge two sorted linked lists and return it as a new list. The new list should be made by splicing tog…
LeetCode刷题之Palindrome Number
Problem Determine whether an integer is a palindrome. Do this without extra space. My Solution public class So…
LeetCode刷题之Two Sum
Problem Given an array of integers, return indices of the two numbers such that they add up to a specific targ…
LeetCode刷题之Reverse Integer
Problem Reverse digits of an integer. Example:x = 123, return 321 Example:x = -123, return -321 Note: The inpu…