diff --git a/Problems/src/Bit/word_square.py b/Problems/src/Bit/word_square.py new file mode 100644 index 0000000..cb0cd45 --- /dev/null +++ b/Problems/src/Bit/word_square.py @@ -0,0 +1,60 @@ +""" +Word Square definition, 0<=k= min_length] + for i, string in enumerate(strs_filtered): + if validate(step, path, string): + path.append(string) + strs.remove(string) + dfs(strs, k, path, step + 1, res) + strs.insert(i, string) + path.pop() + + +TEST = ["ABCD", "BNRT", "CRMY", "DTYE", "CRM", "DT", "DTY"] +print word_square(TEST, 4)