Good solution. I'm not saying there's anything wrong here, this is a great post, but applying the same logic that we have only 26 lower case letters, the time complexity of the PQ solution is O(N*lg(26)), which is also O(N).

==!!.... I guess my point when i started typing was PQ itself slows down the speed.

Rearrange String k Distance Apart