Codewars: Rust workspace for solving the 'Array Diff' kata
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
393 B

3 years ago
  1. Your goal in this kata is to implement a difference function, which subtracts
  2. one list from another and returns the result.
  3. It should remove all values from list a, which are present in list b keeping
  4. their order.
  5. array_diff(vec![1,2], vec![1]) == vec![2] If a value is present in b, all of its
  6. occurrences must be removed from the other:
  7. array_diff(vec![1,2,2,2,3], vec![2]) == vec![1,3]