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

10
LINES

< > BotCompany Repo | #1021447 // multiSetWithoutSingles

JavaX fragment (include)

static <A> MultiSet<A> multiSetWithoutSingles(MultiSet<A> ms) {
  if (ms == null) null;
  MultiSet<A> ms2 = similarEmptyMultiSet(ms);
  for (A a : keys(ms)) {
    int n = ms.get(a);
    if (n > 1)
      ms2.add(a, n);
  }
  ret ms2;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1021447
Snippet name: multiSetWithoutSingles
Eternal ID of this version: #1021447/3
Text MD5: cc135c445fb01f5dd11720c68f48cceb
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-12 23:44:31
Source code size: 243 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 284 / 320
Version history: 2 change(s)
Referenced in: [show references]