dynamic programming

LeetCode 解答 #51. N-Queens プログラミング練習

問題: 難易度: hard 入力: int n 目的: n Queensの条件を満たすすべての回答をListとして返せ 出力: List>Lineの面接試験問題でも出題されたと噂されてる有名な問題ですね。 nQueensの条件は以下の通りです: n*nの盤面があります。(入力のnです) n個のQu…

LeetCode 解答 #44. Wildcard Matching プログラミング練習

問題: 難易度: hard 入力: String s と String p 目的: sがpのパターンと一致するかを判断せよ 出力: boolean正規表現的なものを判断する問題です。 *は任意の文字列を表し、?は任意の文字を表します。 なのでpが'*'であった場合はすべての文字列が該当す…

LeetCode #10. Regular Expression Matching プログラミング練習

問題: Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'.'.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entir…