Company: Goldman_Sachs_12nov
Difficulty: medium
2048 Problem Description In a game called "2048", a 4x4 cell grid is given where each cell can either be empty (denoted by having the value 0) or have a value of 2^k where k is any number from 1 to 11. The aim of the game is to score points by moving the cells in one of four directions: up (U or u), down (D or d), right (R or r), or left (L or l). When one of these four direction buttons is pressed, all the cells in the grid try to move in that direction. During this movement, if any adjacent cells (adjacent in the direction of the movement) have the same value, then they merge and add up. For instance, if there are two adjacent cells in a row with values 4 and 4, and the R button is pressed, the left cell moves right and gets added to the right cell, and itself becomes empty, so "4 4" becomes "0 8". Similarly "16 16" becomes "0 32". However, "2 4" remains "2 4" since the values are different and no merging takes place. Alternately, if the adjacent cell is empty, then the value moves i