Sounds like homework.
Can you describe the algorithm you would use in your own words?
But most importantly: Why is "1 2 3" turned into "1:3" but "5 6 7" turned into "5:6 7"? What rule does that follow?
In reply to Re: Generating ranges of numbers
by Anonymous Monk
in thread Generating ranges of numbers
by nandymamith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |