LendingClub Interview Question

How do you code this (coding question)?