Find the different between 2 sets of number. Example input as below:
input set: [1-5],[2-20]
input negative set: [3-7]
output: [1-2],[8-20]
input set: [3-15],[2-20],[5-10]
input negative set: [3-5], [8-10]
output:[2], [6-7],[11-20]
input set: [1-7],[5-20],[25-100]
input negative set: [6-9], [8-11],[30-50]
output:[1-5], [12-29],[51-100]
input set: [1-7],[10-20],[25-100]
input negative set: [2-5], [11-21],[30-50]
output:[1], [6-7],[10],[25-29],[51-100]
create function that have 2 parameters (array of sets) and result is array of set. Result is first array that remove intersec from second parameter.
This project is tested with Jest.
- Open terminal and enter
npm install
oryarn install
npm run test
oryarn test
for running test