摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
posted @ 2019-07-31 10:54 bossman 阅读(269) 评论(0) 推荐(0) 编辑
摘要: The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each hou 阅读全文
posted @ 2019-07-30 23:11 bossman 阅读(172) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/combination-sum/ Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find a 阅读全文
posted @ 2019-07-18 19:54 bossman 阅读(189) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ Given a binary tree, find the lowest common ancestor (LCA) of two given nodes i 阅读全文
posted @ 2019-07-18 18:04 bossman 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: No 阅读全文
posted @ 2019-07-18 14:03 bossman 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2019-07-17 23:45 bossman 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Given a 2D array A, each cell is 0 (representing sea) or 1 (representing land) A move consists of walking from one land square 4-directionally to anot 阅读全文
posted @ 2019-07-17 18:55 bossman 阅读(220) 评论(0) 推荐(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 @ 2019-07-16 17:20 bossman 阅读(189) 评论(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 @ 2019-07-16 13:57 bossman 阅读(241) 评论(0) 推荐(0) 编辑
摘要: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all 阅读全文
posted @ 2019-07-16 12:02 bossman 阅读(204) 评论(0) 推荐(0) 编辑