Blackbaud interview question

A Leetcode/Hackerrank easy question.