Is there a "nice" way to eliminate consecutive duplicates of list elements?
Example:
["red"; "red"; "blue"; "green"; "green"; "red"; "red"; "yellow"; "white"; "white"; "red"; "white"; "white"]
should become
["red"; "blue"; "green"; "red"; "yellow"; "white"; "red"; "white"]
--By "nice" I mean most readable and understandable to a new user and fast execution :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…