Finding Maximum frequency and window with minimum window size restrictions