S&P Global Interview Question

Mapping out the logic of an algorithm.