Solution for Submission 0