Leetcode Constraints Time Complexity Of Bfs Search Python String