Suppose if i have a big list which looks like :
A
ab1 ab2 ab3 ab5 ab6 ac1 ac2 ac3 ac4 ac5 ac6 ac7 ac8 ac9 xy1 xy2 xy3 xy4 xy5 xy6 xy7 xy8 xy9 xy10 xy11
and
B
ac1 ac4 ac5 ac6 ac7 ac8 xy2 xy3 xy4 xy5 xy6
after doing A - B pattern becomes like :
ab1 ab2 ab3 ab5 xy1 ab6 ac2 ac3 xy7 xy9 xy8 xy10 xy11 ac9
Now i have to sort all values so that it becomes
ab1 ab2 ab3 ab5 ab6 ac2 ac3 ac9 xy1 xy7 xy8 xy9 xy10 xy11
then i need to check the existence of all sequencial values such that i get the 1st and lst values of the sequence.In the above case
ab1 ab2 ab3 are in sequnce so for this part 1st value = ab1 and last value = ab3
ab5 ab6 --- first value = ab5 and last value ab6
ac2 ac3 --- first value = ac2 and last value = ac3
ac9 --- first value and last value same = ac9
xy1 --- first value and last value same = xy1
xy7 xy8 xy9 xy10 xy11 --- first value = xy7 and last value = xy7 and last value = xy11
NOTE:All values in the list or array are unique