I have an array of integers which store only 1 or 0. Is there a direct function in python which would do it?
Suppose the array is [0,1,0,1] then it should return 5.
I have an array of integers which store only 1 or 0. Is there
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you’ve effectively got a bitstring, then you can do: