There were 2 questions on Codility and time limit was 90 mins.
Question 1 (Easy)
Given an array of numbers, in one step you can increment/decrement any value of the array by 1. Determine the minimum no. of ways to make all elements in array equal.
Example, if arr = [1,2,3,4]
Answer should be = 4
Question 2 (Easy)
You are given a 2D integer grid of 0 or 1, where 0 represents free cell and 1 represents a blocked cell.
There is a robot placed initially at [0,0]. Now, given a string of movements (having Up, Down, Left, Right movements), you have to move the robot in the grid (moving when possible, and staying at same cell when move not possible) and return the final position of robot at each movement.
Example, if grid=[[0,0],[1,0]], S = "UDRL"
Answer should be [[0,0], [0,0], [0,1], [0,0]]