
回溯法
永远的EMT
每天时刻保持超越自我的意识
展开
-
【LeetCode】Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great / \ gr ...原创 2018-10-28 23:29:18 · 199 阅读 · 0 评论 -
【LeetCode】Combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] 题解:三种解法,最直接...原创 2018-11-07 01:17:24 · 208 阅读 · 0 评论 -
【LeetCode】Word Search
Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically n...原创 2018-11-07 01:26:43 · 222 阅读 · 0 评论 -
【LeetCode】212. Word Search II
Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horiz...原创 2018-11-10 19:00:07 · 167 阅读 · 0 评论