随笔分类 -  LeetCode

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 61 下一页
摘要:You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int 阅读全文
posted @ 2017-05-01 23:52 Grandyang 阅读(10643) 评论(7) 推荐(1) 编辑
摘要:Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects 阅读全文
posted @ 2017-04-30 08:47 Grandyang 阅读(4602) 评论(1) 推荐(2) 编辑
摘要: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 @ 2017-04-29 23:49 Grandyang 阅读(5652) 评论(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 阅读全文
posted @ 2017-04-27 23:57 Grandyang 阅读(9677) 评论(0) 推荐(0) 编辑
摘要:Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W). You also have several balls i 阅读全文
posted @ 2017-04-25 00:01 Grandyang 阅读(9151) 评论(2) 推荐(0) 编辑
摘要:Given a picture consisting of black and white pixels, and a positive integer N, find the number of black pixels located at some specific row R and col 阅读全文
posted @ 2017-04-24 02:26 Grandyang 阅读(6100) 评论(0) 推荐(0) 编辑
摘要:Given a picture consisting of black and white pixels, find the number of black lonely pixels. The picture is represented by a 2D char array consisting 阅读全文
posted @ 2017-04-23 22:43 Grandyang 阅读(5828) 评论(0) 推荐(0) 编辑
摘要:There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up (u), down (d), left (l) or right (r), but it 阅读全文
posted @ 2017-04-21 23:24 Grandyang 阅读(9892) 评论(0) 推荐(0) 编辑
摘要:You are given a string representing an attendance record for a student. The record only contains the following three characters: A student could be re 阅读全文
posted @ 2017-04-19 23:23 Grandyang 阅读(4718) 评论(0) 推荐(0) 编辑
摘要:There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop roll 阅读全文
posted @ 2017-04-17 22:58 Grandyang 阅读(17329) 评论(24) 推荐(0) 编辑
摘要:Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and is gre 阅读全文
posted @ 2017-04-15 22:43 Grandyang 阅读(9517) 评论(1) 推荐(1) 编辑
摘要: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 @ 2017-04-13 12:17 Grandyang 阅读(7027) 评论(0) 推荐(0) 编辑
摘要:There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different width. Yo 阅读全文
posted @ 2017-04-11 23:56 Grandyang 阅读(5723) 评论(8) 推荐(1) 编辑
摘要:There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct 阅读全文
posted @ 2017-04-09 23:05 Grandyang 阅读(21402) 评论(7) 推荐(0) 编辑
摘要:Given a list of strings, you need to find the longest uncommon subsequence among them. The longest uncommon subsequence is defined as the longest subs 阅读全文
posted @ 2017-04-07 23:38 Grandyang 阅读(8182) 评论(2) 推荐(1) 编辑
摘要:In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial to s 阅读全文
posted @ 2017-04-06 22:52 Grandyang 阅读(5887) 评论(7) 推荐(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 @ 2017-04-04 22:47 Grandyang 阅读(7388) 评论(5) 推荐(0) 编辑
摘要:Given two strings representing two complex numbers. You need to return a string representing their multiplication. Note i2 = -1 according to the defin 阅读全文
posted @ 2017-04-03 01:18 Grandyang 阅读(3484) 评论(0) 推荐(1) 编辑
摘要:Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return the number of important reverse pai 阅读全文
posted @ 2017-04-02 00:00 Grandyang 阅读(18963) 评论(11) 推荐(0) 编辑
摘要:You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty. For each move, you could choose any m (1 ≤ 阅读全文
posted @ 2017-03-30 21:12 Grandyang 阅读(7189) 评论(6) 推荐(0) 编辑

上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 61 下一页
Fork me on GitHub