Goldman Sachs Interview Question

Can’t disclose, but difficulty is comparable with “easy” on hackerrank