Finding CB Numbers

Test Case no. 1, 2 and 3 are failed
Please look into the code and help me find the error