Company: Amazon_29sep
Difficulty: medium
Code Question 2 Problem Description Software developed these days is subject to frequent cyber attacks. To prevent the attacks from succeeding, the security team at Amazon ensures the security of its systems by running tests against n files, where the i th file has size fileSize[i] and there are n viruses. The i th virus attacks the i th file and is only effective against a file with size affinity[i] . To minimize the damage caused, the team performs certain operations. In one operation, the team can choose 2 files, i and j , and swap their sizes, i.e., fileSize[i] and fileSize[j] . Given the sizes of files and the virus' affinities, find the minimum number of operations performed such that fileSize[i] != affinity[i] for each file from 0 to n-1 . If it is not possible to do so after any number of operations, return -1 . Complete the function calculateMinimumSwaps in the editor below. calculateMinimumSwaps has the following parameters: int fileSize[n] : the file sizes int affinity[n] :