aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-332/hvukman/f#/332_p2.fs11
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-332/hvukman/f#/332_p2.fs b/challenge-332/hvukman/f#/332_p2.fs
new file mode 100644
index 0000000000..81c9d24f39
--- /dev/null
+++ b/challenge-332/hvukman/f#/332_p2.fs
@@ -0,0 +1,11 @@
+// 332 part 2
+let inp_list = [| "weekly"; "perl"; "challenge"|];
+
+let odd x = Seq.toList x |>
+ // go over Seq and filter not equal characters
+ List.map (fun y -> String.filter (fun z -> y=z ) x) |>
+ // check if unique characters are in list in multiple of two
+ List.filter (fun w -> String.length(w)%2=0)
+
+for i in inp_list do
+ if List.length(odd i)>0 then printf "false\n" else printf "true\n"