1 | static <A> Pair<A, Int> mostCommonWithCount(LL<A> l) { |
2 | new MultiSet<A> ms; |
3 | for (L<A> c : unnull(l)) ms.addAll(c); |
4 | A s = ms.getMostPopularEntry(); |
5 | ret s == null ? null : pair(s, ms.get(s)); |
6 | } |
Began life as a copy of #1010975
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010976 |
Snippet name: | mostCommonWithCount |
Eternal ID of this version: | #1010976/1 |
Text MD5: | 5c86418e87fcec009eb5080794cfbe21 |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-10-10 20:25:48 |
Source code size: | 203 bytes / 6 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 419 / 461 |
Referenced in: | [show references] |