1 | static int[] intRangeStartGaps(L<IntRange> l) { |
2 | int n = l(l)-1; |
3 | if (n <= 0) null; |
4 | int[] a = new int[n]; |
5 | for i to n: a[i] = l.get(i+1).start-l.get(i).start; |
6 | ret a; |
7 | } |
Began life as a copy of #1025107
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1025112 |
Snippet name: | intRangeStartGaps - ranges must be sorted |
Eternal ID of this version: | #1025112/1 |
Text MD5: | 8c3a4228982291daff77ad3e3af9d4ef |
Author: | stefan |
Category: | javax / maths |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-09-05 19:19:40 |
Source code size: | 180 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 251 / 292 |
Referenced in: | [show references] |