How would you compute the total number of bouquets from a binary pattern where you can form a bouquet from adjacent 0 and 1, or from three adjacent 1s?
Given a binary array, return the maximum number of disjoint bouquets. A bouquet uses either two adjacent, different bits, 01 or 10, or three adjacent 1 bits. Positions may be left unused.
Implement def max_bouquets(pattern):, where pattern is a non-empty list of integers containing only 0 and 1, and return an integer.
def max_bouquets(pattern):