DFS
Data Structures & Algorithms · 6 notes
- Word Breakhistorical
Given a non-empty string s and a list wordDict containing non-empty words, determine whether s can be segmented by spaces into one or more words that appear in the dictionary.
- Word Searchhistorical
Given a two-dimensional grid and a word, determine whether the word exists in the grid.
- Longest Common Substringhistorical
Given two strings str1 and str2, output their longest common substring. The problem guarantees that the longest common substring of str1 and str2 exists and is unique.
- Longest Common Subsequencehistorical
Given two strings text1 and text2, return the length of their longest common subsequence.
- Letter Combinations of a Phone Numberhistorical
Given a string containing only digits 2-9, return all letter combinations it can represent. The answer may be returned in any order.
- Edit Distancehistorical
Given two words word1 and word2, calculate the minimum number of operations required to convert word1 into word2.