Compute rightmost-smaller delay times | Amazon Interview Question