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).

meta-for Range also as DoubleRange {
  sbool rangesOverlap(Range a, Range b) {
    // ret max(a.min, b.min) <= min(a.max, b.max);
    ret intersectRanges(a, b) != null;
  }
}

sbool rangesOverlap(L<Range> l) {
  assertTrue(l(l) == 2); // TODO: more?
  ret rangesOverlap(first(l), last(l));
}

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: 498 / 573
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1023116 - anyOverlap_intRanges