LeetCode solutions javascript python tree memoization algorithm data-structure stack queue leetcode graph iteration trie recursion greedy dfs bfs hash-table binary-search union-find back-tracking Updated Jan 11, 2024 Python npretto / pathfinding Star 180 Code Issues Pull requests Visual explanation...
剑指offer 面试题23:从上往下打印二叉树参与人数:4853 时间限制:1秒 空间限制:32768K提交网址: http://www.nowcoder.com/practice/7fe2212963db4790b57431d9ed259701?tpId=13...
leetcode40 这两个题的不同之处在于,39题同一个元素可以使用多次,这样的话DFS中参数是从i开始的,而40题同一个元素只能使用一次,DFS中参数从i+1开始。另外,DFS函数中的startIndex 参数很重要,否则会出现很多实际上重复的元素,比如{1,2,5}, {2,1,5},当然也可以用map来去重,但是会增加复杂度,最好在一开...