Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Combinations/Emacs-Lisp/combinations.l
Normal file
11
Task/Combinations/Emacs-Lisp/combinations.l
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
(defun comb-recurse (m n n-max)
|
||||
(cond ((zerop m) '(()))
|
||||
((= n-max n) '())
|
||||
(t (append (mapcar #'(lambda (rest) (cons n rest))
|
||||
(comb-recurse (1- m) (1+ n) n-max))
|
||||
(comb-recurse m (1+ n) n-max)))))
|
||||
|
||||
(defun comb (m n)
|
||||
(comb-recurse m 0 n))
|
||||
|
||||
(comb 3 5)
|
||||
Loading…
Add table
Add a link
Reference in a new issue