python
Dashboard
My Repos
Compilers
Python Online
Node JS Online
Golang Online
codepy
Login
My Repos
Sign Out
Online Python Interpreter
Stop
Run
# Python3 implementation of the approach MAX = 256 def canMakeStr2(s1, s2): # Create a count array and count # frequencies characters in s1 count = {s1[i] : 0 for i in range(len(s1))} for i in range(len(s1)): count[s1[i]] += 1 # Now traverse through str2 to check # if every character has enough counts for i in range(len(s2)): if count[s2[i]] == 0: return False count[s2[i]] -= 1 return True inputs = input() inputs = inputs.split(',') chard = ['a','r','t','a','b','d','f','y','h'] if canMakeStr2(s1, s2): print("Yes") else: print("No") # This code is contributed # by Mohit kumar 29
Share this code with others
Public
Clear
My Repos
Repo
Lang
Login
Register
Login
Create a free account. No Credit card info required.
I agree with the Codepy
Term of Service
Sign Up