Asked me to explain pseudocode for following question:
You have a string that is made of 'AM' substring. It can only be expended in 2 ways: 'AMAM', 'AAMM'. Now the 4 letter string can be expanded in 5 ways by inserting 'AM' anywhere in the string. If given a long string, how to check if it is valid and following the above rules