Reddit Interview Question

A leetcode like transaction problem.