
North means +Y direction.
East means +X direction.
South means -Y direction.
West means -X direction.
N = 1, M = 0
COMMANDS = [3], OBSTACLES = []

The final answer would be 9 since it moves 3 steps north.
The first line of input contains an integer ‘T’ denoting the number of test cases.
The first line of each test case contains two space-separated integers ‘N’, ‘M’ Where ‘N’ is the number of COMMANDS and ‘M’ is the number of OBSTACLES.
The next line contains ‘N’ space-separated integers denoting the commands.
The next M lines contain two space-separated integers ‘X’ and ‘Y’, denoting the coordinates of obstacles.
For each test case, return the distance the robot covers. The output of each test case will be printed in a separate line[0-based indexing].
You don't have to print anything, just implement the function.
1 <= T <= 5
1 <= N <= 10^3
1 <= M <= 10^3
-2 <= COMMANDS[i] <= 9
-3 * 10 ^ 3 <= OBSTACLES[i][j] <= 3 * 10 ^ 3
Time limit: 1 second
The main idea is to just simulate the robot’s movement and return the final distance at the end.