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

7
LINES

< > BotCompany Repo | #1001924 // count - count elements of a collection

JavaX fragment (include)

static int count(Collection l, O o) {
  int count = 0;
  for (O x : l)
    if (eq(x, o))
      ++count;
  ret count;
}

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: #1001924
Snippet name: count - count elements of a collection
Eternal ID of this version: #1001924/1
Text MD5: 2eccb85d24992eeb37233d87fab98795
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-12-08 16:34:43
Source code size: 124 bytes / 7 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 813 / 1074
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000382 - Answer for ferdie (>> t = 1, f = 0)