Added complexites & input explanation