O(n) count each charactor then move the window