Ransom Letter

Published by Helen Yu in

Write a function that returns true if you can use the letters of the first string to create the second string. Letters are case sensitive.

Examples

can_build("aPPleAL", "PAL") ➞ true

can_build("aPPleAL", "apple") ➞ false

can_build("a", "") ➞ true

can_build("aa", "aaa") ➞ false

Notes

Letters in the first string can be used only once.

Watch a quick demo on how Edabit works.