I am trying to make a function that would get "legend" for the line of a matrix of 1s and 0s.
Legend is a list in form of List[int]. For e.g. [1,4,2]<
[1,4,2]<