Write a function canBuildWord(letters, word) that checks if you can make word from the letters of letters.
letters can be used only once: 'apple' has one e, so it cannot make 'peel'.'A' and 'a' are the same letter.word can always be made.true or false.Tip: a counter in a Map tells you how many times each letter is still free.
canBuildWord('listen', 'silent')Returns true
canBuildWord('apple', 'peel')Returns false
canBuildWord('Aab', 'aAB')Returns true
canBuildWord('listen', 'silent')truecanBuildWord('cat', 'dog')falsecanBuildWord('abc', '')trueHidden tests run on Submit.