Klarna Interview Question

several logical patterns to fill in