Solutions for Hackerrank problems