Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
13
Task/Matrix-transposition/LFE/matrix-transposition-1.lfe
Normal file
13
Task/Matrix-transposition/LFE/matrix-transposition-1.lfe
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(defun transpose (matrix)
|
||||
(transpose matrix '()))
|
||||
|
||||
(defun transpose (matrix acc)
|
||||
(cond
|
||||
((lists:any
|
||||
(lambda (x) (== x '()))
|
||||
matrix)
|
||||
acc)
|
||||
('true
|
||||
(let ((heads (lists:map #'car/1 matrix))
|
||||
(tails (lists:map #'cdr/1 matrix)))
|
||||
(transpose tails (++ acc `(,heads)))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue