unlucky_1¶
We’ll say that a 1 immediately followed by a 3 in a list is an “unlucky” 1. Return true if the given list contains an unlucky 1 in the first 2 or last 2 positions in the list.
This exercise was taken from codingbat.com and has been adapted for the Python language. There are many great programming exercises there, but the majority are created for Java.