LeetCode Word Search DescriptionGiven a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where “adjacent” cells are those horizontally or ve 8月 12 2015 #leetcode
LeetCode Recover Binary Search Tree DescriptionTwo elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. The original problem is here. The original code is here. 8月 12 2015 #leetcode
LeetCode Surrounded Regions DescriptionGiven a 2D board containing ‘X’ and ‘O’, capture all regions surrounded by ‘X’. A region is captured by flipping all ‘O’s into ‘X’s in that surrounded region. For example, X X X X X O O X X 8月 12 2015 #leetcode
LeetCode Repeated DNA Sequences DescriptionAll DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: “ACGAATTCCG”. When studying DNA, it is sometimes useful to identify repeated sequences within the 8月 10 2015 #leetcode
LeetCode Maximum Gap DescriptionGiven an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 ele 8月 6 2015 #leetcode
LeetCode Maximal Square DescriptionGiven a 2D binary matrix filled with 0’s and 1’s, find the largest square containing all 1’s and return its area. For example, given the following matrix: 1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 8月 5 2015 #leetcode
LeetCode Best Time to Buy and Sell Stock 3 DescriptionSay you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most two transactions. Note:You m 8月 4 2015 #leetcode
LeetCode Search In Rotated Sorted Array 2 DescriptionFollow up for “Search in Rotated Sorted Array”:What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a function to determine if a given target is in 8月 4 2015 #leetcode
LeetCode Search In Rotated Sorted Array DescriptionSuppose a sorted array 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). You are given a target value to search. If found in the array re 8月 4 2015 #leetcode
LeetCode Count Complete Tree Nodes DescriptionGiven a complete binary tree, count the number of nodes. The original problem is here. The original code is here. 8月 4 2015 #leetcode