Written for BSIT 330: Discrete Mathematics (Westcliff University), on April 25, 2021
Reviwed on September 22, 2024
As a common practice, developers are requested to complete code challenges to assess their knowledge of a specific language or prove a certain level of experience in logical conundrums. Usually, such tests ask the programmer to receive a specific input and provide an output based on a series of criteria. Sometimes, the expected solution has to be elegant, be aware of edge cases, and work relatively fast given heavier inputs. However, there are cases that the best solution could be found using a comprehensive understanding of mathematics or other subjects. That is undoubtedly the case of the challenge that is going to be presented in this paper.