In Haskell
, I have the following problem:
I have the following list:
[[17,16,15],[14,13,12],[11,10,9],[8,7,6],[5,4,3],[2,1]]
And I would like to get
[17,16,14,13,11,10,8,7,5,4,2,1]
That is: from each 3-tuple, delete the last component. And if the tuple has fewer elements, do not delete any, as seen in the example.
I put another case, in case I have not explained myself well.
[[10,9,7],[7,5,5],[4,3,1],[0]] --> [10,9,7,5,4,3,0]