Word break problem dynamic programming
Problem : Given a string and an array of words, find out if the input string can be broken into a space-separated sequence of one or more words. For example, inputDict = [“I” ,...
Problem : Given a string and an array of words, find out if the input string can be broken into a space-separated sequence of one or more words. For example, inputDict = [“I” ,...
Backtracking is a general algorithmic technique that considers searching every possible combination in order to solve a problem. It is also known as depth-first search or branch and bound. It is an important tool...
A permutation is a rearrangement of the elements in a list. A string/array of length n has n! permutation. Input: An array // [‘A’, ‘B’, ‘C’] Output: [‘A’, ‘B’, ‘C’] [‘A’, ‘C’, ‘B’], [‘B’,...