Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Samsung Software Developer Hiring Chall…

02 : 20 : 45 left
avinashmallick91@gmail.com Help  End Test
2 Questions Total Marks: 200.0 Question 1
Max. Marks 100.00 

2 Programming Questions
Equal array

1. Equal array + 100.0


You are given two arrays and
 with the same length .
Determine the minimum
2. Sorted arrays + 100.0 number of operations required
to make both the arrays equal.
In an operation, you can take
any two elements and swap it.
You can also swap the
elements by taking an element
from array   and another from
array .

Note: Arrays are equal if 


.

Input format

First line: An integer


Second line:   space-
separated integer
denoting the array 

Third line:   space-


separated integer
denoting the array 

Output format

Print the minimum number of


operations required to make
both the arrays equal. If it is
not possible to print the
number of operations, then
print .
?
Constraints

You might also like