</>OfferRetriever
DashboardDiscuss
NEW

Spring Hire Sale

Limited Time Deal: Unlock all premium questions for over 30% off

$10.42$7.08

08

:

04

:

58

:

48

Get this deal
Back to Dashboard

Top Frequency Substring

Easy

Given a string text containing only lowercase English letters and a positive integer k, find the substring of length k that appears most frequently in text. Overlapping occurrences count separately.

If more than one substring ties for the highest frequency, return the one that comes first in lexicographic order. If no valid substring of length k exists (i.e., k > text.length), return an empty string. ...