From 9593191b62c6cb7afa3438220fc7d0222f48e092 Mon Sep 17 00:00:00 2001 From: Jim Infield Date: Tue, 10 Aug 2021 11:44:03 -0500 Subject: [PATCH] Update README.md --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 769074c..f6580e8 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,15 @@ +## Array Diff + Your goal in this kata is to implement a difference function, which subtracts one list from another and returns the result. It should remove all values from list a, which are present in list b keeping their order. +``` +array_diff(vec![1,2], vec![1]) == vec![2] +``` +If a value is present in b, all of its occurrences must be removed from the other: -array_diff(vec![1,2], vec![1]) == vec![2] If a value is present in b, all of its -occurrences must be removed from the other: - +``` array_diff(vec![1,2,2,2,3], vec![2]) == vec![1,3] - +```