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

6
LINES

< > BotCompany Repo | #1015423 // countIntersection - iterates over first

JavaX fragment (include)

static <A> int countIntersection(Set<A> a, Set<A> b) {
  if (a == null || b == null) ret 0;
  int n = 0;
  for (A x : a) if (b.contains(x)) ++n;
  ret n;
}

Author comment

Began life as a copy of #1009544

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: #1015423
Snippet name: countIntersection - iterates over first
Eternal ID of this version: #1015423/4
Text MD5: c19641d4cbbd5d2b18b384404df66280
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-13 19:41:01
Source code size: 160 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 347 / 372
Version history: 3 change(s)
Referenced in: [show references]