HackerRank Day 26: Nested Logic problem solution - TheCScience