| Module | EasyDiff::Core |
| In: |
lib/easy_diff/core.rb
|
Regular array difference does not handle duplicate values in the way that is needed for this library. Examples:
subtract_arrays([1, 1, 2, 3], [1, 2]) => [1, 3] subtract_arrays([3, 3, 3, 4], [3, 4, 5]) => [3, 3]
Shamelessly stolen from stackoverflow.com/questions/3852755/ruby-array-subtraction-without-removing-items-more-than-once