scala - List of first occurrences in original order -


suppose have x: list[a]. elegant way of building y: list[a] such y contains first occurrence of each element of x, in same order? interested in case a=int if there general solution, better.

as correctly suggested twillouer, use .distinct method. guarantees preserve order expect.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -