</>OfferRetriever
DashboardDiscuss
NEW

Spring Hire Sale

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

$10.42$7.08

08

:

03

:

13

:

51

Get this deal
Back to Dashboard

Top Recurring Substring

Easy

A search analytics service needs to find which fixed-length pattern occurs most often in a block of text.

Given a lowercase string s and a positive integer k, return the substring of length k that appears the greatest number of times in s. If multiple substrings share the highest count, return the one that comes first in lexicographic order. Return an empty string if no valid substring of length k exists. ...