0

this is the list of tuples I have:
[(8, 28), (17, 28), (29, 28)]
Expected output:
[(8, 28), (29, 28)]
I want to keep only the first tuple and the last tuple based on a condition. The condition should say that as long as the first or last elements are the same or within +_1 range, then keep only...