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

11
LINES

< > BotCompany Repo | #1023116 // anyOverlap_intRanges

JavaX fragment (include)

sbool anyOverlap_intRanges(Collection<IntRange> c) {
  if (l(c) < 2) false;
  L<IntRange> l = sortedByField start(c);
  int x = first(l).end;
  for (int i = 1; i < l(l); i++) {
    IntRange r = l.get(i);
    if (r.start < x) true;
    x = r.end;
  }
  false;
}

Author comment

Began life as a copy of #1005876

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: #1023116
Snippet name: anyOverlap_intRanges
Eternal ID of this version: #1023116/5
Text MD5: 61b1920ad4ed9b59c5f3da77a4d8227a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-05-11 13:44:46
Source code size: 270 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 263 / 308
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)