Your question is Command Processing for App Open/Close. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Write a function that processes a sequence of application commands to open apps, close a specified number of recently opened apps, and clear all currently open applications. Use OPEN app, CLOSE k, and CLEAR commands. Return the remaining app names in opening order. The function accepts a list of command strings and returns a list of strings.
OPEN app, CLOSE k, or CLEAR.app is a non-empty string without spaces.k is a non-negative integer.def process_commands(commands):