Ruby | Matrix to_a() function
The to_a() is an inbuilt method in Ruby returns an array which has all the elements of the matrix row-wise.
Parameters: The function needs the matrix which is to be converted to an array.
Return Value: It returns an array.
3 12 2 8
1 0 6 1 1 2