Day 9: Complete P49 and P50

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>