Not getting correct answer

I am not able to figure out what is wrong in my implementation. I followed the same approach as discussed in the video