Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,15 @@
function ExpandRanges(ranges : String) : array of Integer;
begin
for var range in ranges.Split(',') do begin
var separator = range.IndexOf('-', 2);
if separator > 0 then begin
for var i := range.Left(separator-1).ToInteger to range.Copy(separator+1).ToInteger do
Result.Add(i);
end else begin
Result.Add(range.ToInteger)
end;
end;
end;
var expanded := ExpandRanges('-6,-3--1,3-5,7-11,14,15,17-20');
PrintLn(JSON.Stringify(expanded));