Verifying if a string can be created with the letters of another string
Your logic seems hard to follow.  Why spread str2 to array, which you then read into a Set, only to turn around and make the Set into an array, which you then iterate, comparing each letter’s count in each string by splitting them repeatedly?
You see how long and convoluted that sentence was? The last line of code there is kind of the same, dense and hard to follow.
The problem should be solved by counting characters for str1 into map keyed by each letter. You then iterate through str2 and decrement those counters. If any counter goes to -1 you have false condition.  This approach means each letter in passed string only needs to be visited once making performance linear to the combined length of the strings in operational complexity.  Your current solution has exponential complexity.