Solve this coding problem:
/**
* Give an array of integers, which might containt 0, 1, 2, .. 0 can be repeated.
* shift the non-zero elements at the beginning of the array, and maintain the order.
* 0, 1, 0, 3, 12
* the final array should be like this:
* 1, 3, 12, 0, 0
*/