Guys I love college board so much...I have two AP exams tomorrow (gotta get up at 6:30), two the next day, one the next day, two the next day, another the next day, then another the next week
@RydwolfPrograms this does still look like a pretty hard problem though. There are so many edge cases if one wanted to solve this with rules that you might as well just use a brute force approach. For example: You want to use "c" and "m" on the largest numbers (zombies), ideally "c" on the very largest, except if that number is so low in the stack that the numbers behind it are not big enough for that to have enough of an effect. I don't know how to prove a general rule would work.
There's a proposal to move N up before M. (I've been a proponent of this at least since I was in 3rd grade.) You can see it already implemented in BQN which is named after incrementing the letters of APL β assuming N before M.