__builtin__popcount

how to declare this fxn in the scope

@Himanshukaushik1772,
You don’t need to declare it, as the name suggests, it is builtin. You can directly use it. Eg here.