rom

Here’s the shortcut code - unfortunately, I couldn’t post the pseudocode without preserving the format.