Microsoft OA | Minimum fuel consumption | Carpool scheme | 2022
Anonymous User
4188

Can someone please help me solve this problem?

image

Sample tests:
Input 1:
int[] A = {0,0,0,1,1,1,9,9,9};
int[] B = {7,8,1,2,3,9,4,5,6};

Output 1:
10

Input 2:
int[] A = {0,1,1}
int[] B = {1,2,3}

Output2:
3

Comments (13)