6 line Solution using python3 yt

class Solution:
    def power(self, A):
            return 0
        if(b.count('1')==1 and b[0]=='1'):
            return 1
        return 0

suggestions are welcomed.Preformatted text


Hey, can i know why did u do b[0]==‘1’ ? Whats the use of this condition?


No use of this condition. Even I don’t remember why I wrote like that. Maybe the thought process was different that time.


Intention of question is to solve by storing the numbers in array, not by using builtin libraries.