Find Repetitions

Problem Overview

  • Compute the maximum number of consecutive repetitions of short_s within long_s.
  • Inputs: short_s and long_s; Output: non-negative integer count; if either string is empty, return 0.
  • Constraints: 0 <= len(short_s) < 10 and 0 <= len(long_s) < 1,000,000.
  • Real-world context: string processing/text analytics, detecting repeated patterns in large text; a common coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: