Problem 6

Signed-off-by: Thameera Senanayaka <thameera123@gmail.com>