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

11
LINES

< > BotCompany Repo | #1005876 // rangesOverlap

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (10921L/60K).

1  
meta-for Range also as DoubleRange {
2  
  sbool rangesOverlap(Range a, Range b) {
3  
    // ret max(a.min, b.min) <= min(a.max, b.max);
4  
    ret intersectRanges(a, b) != null;
5  
  }
6  
}
7  
8  
sbool rangesOverlap(L<Range> l) {
9  
  assertTrue(l(l) == 2); // TODO: more?
10  
  ret rangesOverlap(first(l), last(l));
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005876
Snippet name: rangesOverlap
Eternal ID of this version: #1005876/3
Text MD5: 486bd4efeb85267d5d2945fc0d5d87b6
Transpilation MD5: 4a20ba617c4304656a310a255616a0df
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-05-18 18:06:21
Source code size: 301 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 499 / 574
Version history: 2 change(s)
Referenced in: [show references]