Solution for practicing 'kata' problems