Finding CB Numbers

What is wrong in this code .I am having 3 out 9 test cases failed