Solution for Problem 04