Company: Agoda_8nov
Difficulty: medium
Assigned Parking Problem Description There are `n` cars located on a 2-dimensional plane at positions `(x[i], y[i])`. They need to be parked in a straight line parallel to the x-axis with no spaces between them. The fuel consumed to move a car is `abs(x[finish] - x[start]) + abs(y[finish] - y[start])`. Determine the minimum total fuel cost to arrange all cars side-by-side in a row parallel to the x-axis. For example, if `x = [1, 4]` and `y = [1, 4]`, one optimal solution is: Car at `(1, 1)` moves to `(3, 1)`, using `abs(3-1) + abs(1-1) = 2 + 0 = 2` fuel. Car at `(4, 4)` moves to `(4, 1)`, using `abs(4-4) + abs(1-4) = 0 + 3 = 3` fuel. The total minimum fuel cost is `2 + 3 = 5`. Complete the function `minFuel` in the editor with the following parameters: `int x[]`: the x coordinates `int y[]`: the y coordinates The function should return an `int` representing the minimum fuel required to move all of the cars. Examples Example 1: Input: n = 2 x = [1, 5] y = [1, 5] Output: 7 Explanation: I