随笔分类 -  DFS

摘要:Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文 »
posted @ 2019-05-31 22:30 Veritas_des_Liberty 阅读(172) 评论(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 @ 2019-05-31 21:18 Veritas_des_Liberty 阅读(24189) 评论(0) 推荐(0) 编辑
摘要:Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one s 阅读全文 »
posted @ 2019-05-30 22:32 Veritas_des_Liberty 阅读(252) 评论(0) 推荐(0) 编辑
摘要:Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal. Example 1: Example 2: Note: 0 < s1.length, s2.len 阅读全文 »
posted @ 2019-03-14 20:53 Veritas_des_Liberty 阅读(234) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all 阅读全文 »
posted @ 2019-03-14 18:46 Veritas_des_Liberty 阅读(237) 评论(0) 推荐(0) 编辑
摘要:In LeetCode Store, there are some kinds of items to sell. Each item has a price. However, there are some special offers, and a special offer consists 阅读全文 »
posted @ 2019-03-10 21:30 Veritas_des_Liberty 阅读(250) 评论(0) 推荐(0) 编辑
摘要:In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o 阅读全文 »
posted @ 2019-02-28 09:55 Veritas_des_Liberty 阅读(331) 评论(0) 推荐(0) 编辑
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文 »
posted @ 2019-02-16 20:51 Veritas_des_Liberty 阅读(295) 评论(0) 推荐(0) 编辑
摘要:On a 2-dimensional grid, there are 4 types of squares: 1 represents the starting square. There is exactly one starting square. 2 represents the ending 阅读全文 »
posted @ 2019-02-08 23:23 Veritas_des_Liberty 阅读(353) 评论(0) 推荐(0) 编辑
摘要:A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents 阅读全文 »
posted @ 2019-02-06 00:38 Veritas_des_Liberty 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: I 阅读全文 »
posted @ 2019-02-05 23:02 Veritas_des_Liberty 阅读(179) 评论(0) 推荐(0) 编辑
摘要:Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negative positions.) Your car drives automatically accord 阅读全文 »
posted @ 2018-12-23 18:57 Veritas_des_Liberty 阅读(326) 评论(0) 推荐(0) 编辑
摘要:There are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w. Now given all the cities and flights, togeth 阅读全文 »
posted @ 2018-12-22 13:05 Veritas_des_Liberty 阅读(302) 评论(0) 推荐(0) 编辑
摘要:There are N network nodes, labelled 1 to N. Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v  阅读全文 »
posted @ 2018-12-22 12:10 Veritas_des_Liberty 阅读(310) 评论(0) 推荐(0) 编辑
摘要:Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top 阅读全文 »
posted @ 2018-12-15 22:21 Veritas_des_Liberty 阅读(242) 评论(0) 推荐(0) 编辑
摘要:There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to 阅读全文 »
posted @ 2018-12-14 21:28 Veritas_des_Liberty 阅读(188) 评论(0) 推荐(0) 编辑
摘要:There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0 you have to 阅读全文 »
posted @ 2018-12-13 21:33 Veritas_des_Liberty 阅读(211) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example: Approach #1: C++. [recursive] Approach #2: Java. 阅读全文 »
posted @ 2018-12-11 21:51 Veritas_des_Liberty 阅读(161) 评论(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 @ 2018-12-11 20:39 Veritas_des_Liberty 阅读(217) 评论(0) 推荐(0) 编辑
摘要:Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick 阅读全文 »
posted @ 2018-12-11 16:51 Veritas_des_Liberty 阅读(236) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示