Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,63 @@
|
|||
2 3 5 7 11 13 17 19 cats 222 (-100.2) "+11" (1.1) "+7" (7.) 7 5 5 3 2 0 (4.4) 2:?LIST
|
||||
|
||||
(A=
|
||||
( Hashing
|
||||
= h elm list
|
||||
. new$hash:?h
|
||||
& whl
|
||||
' ( !arg:%?elm ?arg
|
||||
& ( (h..find)$str$!elm
|
||||
| (h..insert)$(str$!elm.!elm)
|
||||
)
|
||||
)
|
||||
& :?list
|
||||
& (h..forall)
|
||||
$ (
|
||||
= .!arg:(?.?arg)&!arg !list:?list
|
||||
)
|
||||
& !list
|
||||
)
|
||||
& put$("Solution A:" Hashing$!LIST \n,LIN)
|
||||
);
|
||||
|
||||
(B=
|
||||
( backtracking
|
||||
= answr elm
|
||||
. :?answr
|
||||
& !arg
|
||||
: ?
|
||||
( %?`elm
|
||||
?
|
||||
( !elm ?
|
||||
| &!answr !elm:?answr
|
||||
)
|
||||
& ~
|
||||
)
|
||||
| !answr
|
||||
)
|
||||
& put$("Solution B:" backtracking$!LIST \n,LIN)
|
||||
);
|
||||
|
||||
(C=
|
||||
( summing
|
||||
= sum car LIST
|
||||
. !arg:?LIST
|
||||
& 0:?sum
|
||||
& whl
|
||||
' ( !LIST:%?car ?LIST
|
||||
& (.!car)+!sum:?sum
|
||||
)
|
||||
& whl
|
||||
' ( !sum:#*(.?el)+?sum
|
||||
& !el !LIST:?LIST
|
||||
)
|
||||
& !LIST
|
||||
)
|
||||
& put$("Solution C:" summing$!LIST \n,LIN)
|
||||
);
|
||||
|
||||
( !A
|
||||
& !B
|
||||
& !C
|
||||
&
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue