Template and helper methods for the hackerrank problems.