Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

6
LINES

< > BotCompany Repo | #1030901 // multiSetToPairsByPopularity

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (3219L/19K).

1  
static <A> LPair<A, Int> multiSetToPairsByPopularity(MultiSet<A> ms) {
2  
  new LPair<A, Int> l;
3  
  if (ms != null) for (A a : ms.highestFirst())
4  
    l.add(pair(a, ms.get(a)));
5  
  ret l;
6  
}

Author comment

Began life as a copy of #1030109

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030901
Snippet name: multiSetToPairsByPopularity
Eternal ID of this version: #1030901/1
Text MD5: 613c1612d28cfcfe37c1fd4f48965bc8
Transpilation MD5: 573f6066d3ead23098333d5d859de432
Author: stefan
Category: javax / collections
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-08 15:26:55
Source code size: 188 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 173 / 273
Referenced in: [show references]