https://linen.dev logo
does something like this work no need for a map. `...
# haxe
o
does something like this work no need for a map.
Copy code
Haxe 
var arr = new Array<{value:T,count:Int}>();  
for( thing in stuff ){ 
  var found = false;
  for( item in arr ){
    if( thing == item.value ){
       found = true;
       item.count++;
    }
  }
  if( found == false ){
     arr.push( { value: thing, count: 1 } ); 
  }
}
// implement custom sort on item.count. detail for reader.