Computer Science, asked by anushajampala555, 6 months ago

Rob has gone to Mars to collect some stones. The bag he is carrying can hold a maximum weight of M. There are M stones weighing from 1 to Min Mars. There are N stones on Mars that are similar to the ones on Earth. Find the number of stones he can bring from Mars such that none of them are similar to any stone on Earth. Input Specification: inputi: M. denoting the size of the bag and the number of different stone weights present on Mars. input2: N, denoting the number of common stones on Earth and Mars. input3: An N element array containing the list of the weights of the common stones, Output Specification: Your function should return the maximum unique stones that can be collected from Mars.​

Answers

Answered by rathsongaming
0

Mars Stone

Rob has gone to Mars to collect some stones. The bag he is carrying can hold a maximum weight of M.

There are M stones weighing from 1 to Min Mars. There are N stones on Mars that are similar to the

ones on Earth. Find the number of stones he can bring from Mars such that none of them are similar to

any stone on Earth.

Input Specification:

inputi: M. denoting the size of the bag and the number of different stone

weights present on Mars.

input2: N, denoting the number of common stones on Earth and Mars.

input3: An N element array containing the list of the weights of the common

stones,

Output Specification:

Your function should return the maximum unique stones that can be collected

from Mars.

Similar questions