Python for beginners:
https://www.youtube.com/watch?v=egq7Z...
Code:
class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
g=0;
for i in ransomNote:
t=ransomNote.count(i);
s=magazine.count(i);
if(t>s):
g+=1;
if(g==0):
return True;
else:
return False;
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/piraw...
Code:
class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
g=0;
for i in ransomNote:
t=ransomNote.count(i);
s=magazine.count(i);
if(t>s):
g+=1;
if(g==0):
return True;
else:
return False;
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/piraw...
0 Comments:
Post a Comment