Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Rep-string/LFE/rep-string-1.lfe
Normal file
13
Task/Rep-string/LFE/rep-string-1.lfe
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
(defun get-reps (text)
|
||||
(lists:filtermap
|
||||
(lambda (x)
|
||||
(case (get-rep text (lists:split x text))
|
||||
('() 'false)
|
||||
(x `#(true ,x))))
|
||||
(lists:seq 1 (div (length text) 2))))
|
||||
|
||||
(defun get-rep
|
||||
((text `#(,head ,tail))
|
||||
(case (string:str text tail)
|
||||
(1 head)
|
||||
(_ '()))))
|
||||
10
Task/Rep-string/LFE/rep-string-2.lfe
Normal file
10
Task/Rep-string/LFE/rep-string-2.lfe
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
(defun report
|
||||
((`#(,text ()))
|
||||
(io:format "~p has no repeating characters.~n" `(,text)))
|
||||
((`#(,text (,head . ,_)))
|
||||
(io:format "~p repeats ~p every ~p character(s).~n" `(,text ,head ,(length head))))
|
||||
((data)
|
||||
(lists:map
|
||||
#'report/1
|
||||
(lists:zip data (lists:map #'get-reps/1 data)))
|
||||
'ok))
|
||||
Loading…
Add table
Add a link
Reference in a new issue