My 33 is a terrible solution. Please add more test cases.
Tim's 80 is very good and my 83 is also valid. Addition of a common random value at an end overlap will eliminate chicanery. v=randi(100) [1 2 3 v] [v 4 5].