Collaps arrays/ list of intergers

2014-08-19 Thread Jurgens de Bruin
Hi All, I do hope somebody can help me with the following: I have the followings lists which represent the upper and lower value of a range/array. a = [1,50] b = [75,150] c = [25,42] d = [120,149] e = [35,55] What I would like to happen is that overlapping range will collapse to a single

Re: Collaps arrays/ list of intergers

2014-08-19 Thread Peter Pearson
On Tue, 19 Aug 2014 05:54:24 -0700 (PDT), Jurgens de Bruin wrote: I do hope somebody can help me with the following: I have the followings lists which represent the upper and lower value of a range/array. a = [1,50] b = [75,150] c = [25,42] d = [120,149] e = [35,55] What I would like

Re: Collaps arrays/ list of intergers

2014-08-19 Thread Peter Otten
Jurgens de Bruin wrote: Hi All, I do hope somebody can help me with the following: I have the followings lists which represent the upper and lower value of a range/array. a = [1,50] b = [75,150] c = [25,42] d = [120,149] e = [35,55] What I would like to happen is that overlapping

Re: Collaps arrays/ list of intergers

2014-08-19 Thread Rock Neurotiko
Hi, I made a fast implementation (I'm sure that can be done better) but it works (for what I understood). Is tested in Python3.4, if you will execute in Python 2.x, or don't have mypy or don't like it, you always can remove the function annotations :)

Re: Collaps arrays/ list of intergers

2014-08-19 Thread Denis McMahon
On Tue, 19 Aug 2014 05:54:24 -0700, Jurgens de Bruin wrote: I do hope somebody can help me with the following: I have the followings lists which represent the upper and lower value of a range/array. a = [1,50] b = [75,150] c = [25,42] d = [120,149] e = [35,55] I think you're starting