Sigmoid interview question

Basic easy to moderate dsa