June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1,12 +1,12 @@
|
|||
fun abc(s, list):
|
||||
return true if s.empty
|
||||
for i in [:list.size]:
|
||||
return any([abc(s[:!1], delete(val list, i))]) ...
|
||||
if s[!0] in list[i] else true
|
||||
fun abc(str, list):
|
||||
if list.isEmpty: return true
|
||||
for i in indices(list) where s[!1] in list[i]:
|
||||
return abc(str[:!2], remove(val list, i))
|
||||
false
|
||||
|
||||
let test = ["A", "BARK","BOOK","TREAT","COMMON","SQUAD","CONFUSE"]
|
||||
let list = ["BO","XK","DQ","CP","NA","GT","RE","TG","QD","FS","JW",
|
||||
"HU","VI","AN","OB","ER","FS","LY","PC","ZM"]
|
||||
for s in test:
|
||||
print "$:.-8(s) | $(abc(s, list))"
|
||||
let list = ["BO","XK","DQ","CP","NA","GT","RE","TG","QD","FS",
|
||||
"JW","HU","VI","AN","OB","ER","FS","LY","PC","ZM"]
|
||||
|
||||
for str in test:
|
||||
print "$:>8(s) | $(abc(s, list))"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue