摘要: You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
posted @ 2018-12-05 22:55 A-Little-Nut 阅读(89) 评论(0) 推荐(0) 编辑
摘要: Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文
posted @ 2018-12-05 22:54 A-Little-Nut 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Given an m n matrix M initialized with all 0‘s and several update operations. Operations are represented by a 2D array, and each operation is represen 阅读全文
posted @ 2018-12-05 22:52 A-Little-Nut 阅读(68) 评论(0) 推荐(0) 编辑
摘要: We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra 阅读全文
posted @ 2018-12-05 22:50 A-Little-Nut 阅读(93) 评论(0) 推荐(0) 编辑
摘要: There is an m by n grid with a ball. Given the start coordinate (i,j) of the ball, you can move the ball to adjacent cell or cross the grid boundary i 阅读全文
posted @ 2018-12-05 22:49 A-Little-Nut 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2018-12-05 22:46 A-Little-Nut 阅读(87) 评论(0) 推荐(0) 编辑
摘要: In MATLAB, there is a very useful function called ‘reshape’, which can reshape a matrix into a new one with different size but keep its original data. 阅读全文
posted @ 2018-12-05 22:44 A-Little-Nut 阅读(112) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt 阅读全文
posted @ 2018-12-05 22:41 A-Little-Nut 阅读(88) 评论(0) 推荐(0) 编辑
摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of mi 阅读全文
posted @ 2018-12-05 22:40 A-Little-Nut 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
posted @ 2018-12-05 22:38 A-Little-Nut 阅读(95) 评论(0) 推荐(0) 编辑
摘要: You are given a string representing an attendance record for a student. The record only contains the following three characters: ‘A’ : Absent. ‘L’ : L 阅读全文
posted @ 2018-12-05 22:37 A-Little-Nut 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath betwee 阅读全文
posted @ 2018-12-05 22:35 A-Little-Nut 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there ar 阅读全文
posted @ 2018-12-05 22:32 A-Little-Nut 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all 阅读全文
posted @ 2018-12-05 22:31 A-Little-Nut 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree with non negative values, find the minimum absolute difference between values of any two nodes. Example: Note: There are at 阅读全文
posted @ 2018-12-05 22:30 A-Little-Nut 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi 阅读全文
posted @ 2018-12-05 22:29 A-Little-Nut 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of 阅读全文
posted @ 2018-12-05 22:20 A-Little-Nut 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 分 阅读全文
posted @ 2018-12-05 22:18 A-Little-Nut 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Example 2: Note: You may assume the tree (i.e., the given root no 阅读全文
posted @ 2018-12-05 22:16 A-Little-Nut 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: “Gold Medal”, “Sil 阅读全文
posted @ 2018-12-05 22:14 A-Little-Nut 阅读(90) 评论(0) 推荐(0) 编辑