Finding CB numbers

Why am i failing testcases 6, 7, 8.