Solution for other cases Part 1 Problem Solving

Checked solution for all cases