1 | sbool anyOverlap_intRanges(Collection<IntRange> c) { |
2 | if (l(c) < 2) false; |
3 | L<IntRange> l = sortedByField start(c); |
4 | int x = first(l).end; |
5 | for (int i = 1; i < l(l); i++) { |
6 | IntRange r = l.get(i); |
7 | if (r.start < x) true; |
8 | x = r.end; |
9 | } |
10 | false; |
11 | } |
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: | 262 / 308 |
Version history: | 4 change(s) |
Referenced in: | [show references] |