i have an array with sorted integers
array = [1,4,10,14,22]
i would like to create from array before an
array_with_ranges = [[0..1],[2..4],[5..10],[11..14],[15..22]]
i cant create a right iterator, i'm newbie in rails. In every ranges i have end_range value, but don't know how to set a start_range value? in most ranges in array_with_ranges the start_range is a end_range before +1 (except [0..1])
any solutions or ideas?
thank you for answers.
p.s.: happy new 2015 year