Company: Flipkart
Difficulty: medium
Make Equal Two warehouse robots, Robot P and Robot Q, each hold a permutation of the integers 1 through N in their own arrays, A and B. They want to reach a state where both arrays match exactly: same length, and the same value sitting at every matching index. On each turn, either robot may delete one integer from its own array. Working together under an optimal strategy, find the smallest total number of deletions needed before the two arrays match. Input Format Line one gives a single integer N, the common length of both permutations. Lines two and three each hold N space-separated integers: the values of permutation A, then the values of permutation B. Code Template #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <bits/stdc++.h> using namespace std; int main() { /* Enter your code here */ return 0; }