How to filter and sort dictionary (Map) in Kotlin
I am trying to filter and sort dictionary (map) in Kotlin: by key = shouldShow. Is shouldShow = true, sort these objects by key = displayOrder in descending order and get string list with state names. Is it possible to do it and how? Because I am trying and nothing works.
Thanks in advance.
Map:
[{shouldShow=true, displayOrder=2, state=Alaska}, {shouldShow=false, displayOrder=3, state=Texas}, {shouldShow=true, displayOrder=1, state=Arizona}]