Lucy is playing Hop, Skip and Jump on an N*M grid. Beginning at position (1,1), she travels around the matrix in an anti-clockwise direction while landing on every other cell. Determine the value in the final cell she lands on.
Create an algorithm that identifies Lucy's last visited cell when she moves anti-clockwise and skips alternating cells.
Input
The first input line contains two integers, matrix_row and matrix_col, which specify the matrix row count (N) and column count (M).
The following N lines each contain M space-separated integers that give the values stored in the matrix cells.
Output
Output one integer: the value of the last cell Lucy hops onto after applying the described movement.
Constraints:
Input: matrix = [[6, 12, 19], [4, 27, 8], [11, 3, 15]]
Output: 27
Lucy traverses anti-clockwise, landing on every other cell and ending at value 27.