Unstub

Compare letters and countsMedium

Determine if Two Strings Are Close

You may swap any two letters of a word, or turn every one of a letter into another letter that is in it and every one of that into the first. Say whether word1 can become word2 this way.

Aim for O(n) time, O(1) space (26 letters)Inspired by a classic interview problem ↗