Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
1 files changed, 8 insertions, 0 deletions
-rw-r--r--Year 2/Functional Programming/hw3.hs8
diff --git a/Year 2/Functional Programming/hw3.hs b/Year 2/Functional Programming/hw3.hs
new file mode 100644
index 0000000..432285a
--- /dev/null
+++ b/Year 2/Functional Programming/hw3.hs
@@ -0,0 +1,8 @@
+-- Задача 2
+
+countUniques :: String -> Int
+countUniques inpt = length (filter (\v -> elem v [2, 3, 4, 7]) (map length (drop 11 (words inpt))))
+
+main :: IO()
+main = do
+ print(countUniques "be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe")