Affirm Interview Question

Basic binary tree question, average complexity.