added code to coding question asked in hike's coding round