There are multiple bags each containing known number of coins. If you take a bag, you cannot take any of its neighboring bags. Write a recursive function that takes a list containing the information about number of coins in each bag and returns the maximum possible number of coins you can take from all bags.
max_coins([9, 7, 14, 18, 6]) -> 29
max_coins([1, 2, 3, 4, 5, 6]) -> 12