diff options
| Commit | 44afe3c90c7e911ab96c0971db87bafcc12e935f (patch) | |
|---|---|---|
| Author | 2022-12-17 16:20:10 +0200 | |
| Committer | 2022-12-17 16:20:10 +0200 | |
| Files | 766be76f1138fb5a3859648a23b2c7cd116e6225 | |
| uni-projects-44afe3c90c7e911ab96c0971db87bafcc12e935f.tar uni-projects-44afe3c90c7e911ab96c0971db87bafcc12e935f.tar.gz uni-projects-44afe3c90c7e911ab96c0971db87bafcc12e935f.zip | ||
| Parent | 1507f3b1c71d670e618ce615f681e4e796080d20 (diff) | |
[FP/HW3] Solved second exercise, without the file parsing
1 files changed, 8 insertions, 0 deletions
| -rw-r--r-- | Year 2/Functional Programming/hw3.hs | 8 |
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") |
