Cool! But you're comparing apples with oranges.
Besides which, your solution contains bugs.
Update:Dataset removed as it seems that PM cannot handle it. Despite that it appeared fine in preview.
If you want the data set which I observed produces this incorrect output (note the second last range is invalid) I can email it to you.:
C:\test>junk88 935755.dat
[
["010005", "010022", 41],
["010023", "012359", 0],
["020000", "022359", 0],
["030000", "032359", 0],
["040000", "042359", 0],
["050000", "052359", 0],
["060000", "062359", 0],
["070000", "072359", 0],
["080000", "082359", 0],
["090000", "092359", 0],
[100000, 102359, 0],
[110000, 112359, 0],
[120000, 122359, 0],
[130000, 132359, 0],
[140000, 142359, 0],
[150000, 152359, 0],
[160000, 162359, 0],
[170000, 172359, 0],
[180000, 182359, 0],
[190000, 192359, 0],
[200000, 202359, 0],
[210000, 212359, 0],
[220000, 222359, 0],
[230000, 232359, 0],
[240000, 242359, 0],
[250000, 252359, 0],
[260000, 262359, 0],
[270000, 272359, 0],
[280000, 282359, 0],
[290000, 292359, 0],
[300000, 302359, 0],
[310000, 312356, 0],
[312357, 312356, 52],
[312357, 312359, 27],
]
Instead of this outptu: C:\test>935755 935755.dat
[
["010005", "010022", 41],
["010023", "012359", 0],
["020000", "022359", 0],
["030000", "032359", 0],
["040000", "042359", 0],
["050000", "052359", 0],
["060000", "062359", 0],
["070000", "072359", 0],
["080000", "082359", 0],
["090000", "092359", 0],
[100000, 102359, 0],
[110000, 112359, 0],
[120000, 121942, 0],
[121943, 122359, 0],
[130000, 132359, 0],
[140000, 142359, 0],
[150000, 152359, 0],
[160000, 162359, 0],
[170000, 172359, 0],
[180000, 182359, 0],
[190000, 192359, 0],
[200000, 202359, 0],
[210000, 211659, 0],
[211700, 211741, 0],
[211742, 212359, 0],
[220000, 222359, 0],
[230000, 232359, 0],
[240000, 242359, 0],
[250000, 252359, 0],
[260000, 262359, 0],
[270000, 272359, 0],
[280000, 282355, 0],
[282356, 282359, 0],
[290000, 292359, 0],
[300000, 300936, 0],
[300937, 302359, 0],
[310000, 311315, 0],
[311316, 312042, 0],
[312043, 312159, 0],
[312200, 312356, 0],
[312357, 312359, 27],
]
|