An eToro watchlist component stores market-status markers in an array. Each marker is encoded as 0 for green and 1 for red. Rearrange the array in place so that all green markers appear before all red markers.
Implement a function that modifies the input list directly and returns the same list. Do not use Python's built-in sorting function or allocate another array.
Given a list colors containing only integers 0 and 1, reorder it so every 0 appears before every 1. The relative order among equal values does not matter. Return the modified list.
def sort_two_colors(colors):