It means you have two extra special cases: 1) list is empty; 2) left edge is the right edge (I.e. length is 1)
Conditionals are great because they're clear and concise...
if not list: # Can't do anything with this
return # or raise error
if len(list) < 3: # Ditto
return #ditto
Sure, there's more code but it's not bad code. It's just straightforward stuff that's easy to read and debug (if necessary).