Created
October 13, 2014 06:50
-
-
Save pkulev/dd4194dd2191938d5fa2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun {Prefix L1 L2} | |
case L1 | |
of H|T then | |
if H == L2.1 then {Prefix T L2.2} | |
else false end | |
[] nil then true | |
end | |
end | |
fun {FindString L1 L2} | |
case L2 | |
of H|T then | |
if L1.1 == H then {Prefix L1 L2} | |
else {FindString L1 T} end | |
[] nil then | |
if L1 == nil then true | |
else false end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
perfect!