there n seat n student room you give array seat length n seatsi position ith seat you give array student length n studentsj position jth studentyou perform follow number timesincrease decrease position ith student 1 ie move ith student position x x 1 x 1return minimum number move require student seat student seatnote multiple seat student position begin Example 1input seat 315 student 274output 4explanation the student move follow the student move position 2 position 1 1 the second student move position 7 position 5 2 move the student move position 4 position 3 1 movein total 1 2 1 4 move usedexample 2input seat 4159 student 1326output 7explanation the student move follow the student move the second student move position 3 position 4 1 the student move position 2 position 5 3 move the fourth student move position 6 position 9 3 movesIn total 0 1 3 3 7 move usedexample 3input seat 2266 student 1326output 4explanation Note seat position 2 seat position 6the student move follow the student move position 1 position 2 1 the second student move position 3 position 6 3 move the student move the fourth student movedIn total 1 3 0 0 4 move Constraintsn seatslength studentslength1 n 1001 seatsi studentsj 100