Vasya decided to write an anonymous letter cutting the letters out of a newspaper heading. He knows heading *s*<sub class="lower-index">1</sub> and text *s*<sub class="lower-index">2</sub> that he wants to send. Vasya can use every single heading letter no more than once. Vasya doesn't have to cut the spaces out of the heading — he just leaves some blank space to mark them. Help him; find out if he will manage to compose the needed text.
The first line contains a newspaper heading *s*<sub class="lower-index">1</sub>. The second line contains the letter text *s*<sub class="lower-index">2</sub>. *s*<sub class="lower-index">1</sub> и *s*<sub class="lower-index">2</sub> are non-empty lines consisting of spaces, uppercase and lowercase Latin letters, whose lengths do not exceed 200 symbols. The uppercase and lowercase letters should be differentiated. Vasya does not cut spaces out of the heading.
function canWriteAnonymousLetter(s1: string, s2: string): boolean {
    // Create a copy of s1 to modify
    s1_copy = s1

    // Iterate through the letters in s2
    for (let i = 0; i < s2.length; i++) {
        let found = false
        // Check if the letter appears in s1_copy
        for (let j = 0; j < s1_copy.length; j++) {
            if (s1_copy[j] == s2[i]) {
                // Remove the letter from s1_copy
                s1_copy = s1_copy.substring(0, j) + s1_copy.substring(j + 1)
                found = true
                break
            }
        }
        // If the letter does not appear in s1_copy, check for a space
        if (!found) {
            if (!s1_copy.includes(' ')) {
                return false
            } else {
                s1_copy = s1_copy.replace(' ', '')
            }
        }
    }
    return true
}
