Quiz 2
Registry Synced

Synthetic 2 · Repeated K Times

83 words
1 min read
2026-08-02

Repeated K Times

Write is_repeated_k_times(s, k). Return True only when non-empty string s consists of one non-empty block repeated exactly k times. Return False when k <= 0.

Template Code

python
def is_repeated_k_times(s, k):
    pass

Public Tests

is_equal(is_repeated_k_times("abababab", 4), True) is_equal(is_repeated_k_times("abcabcab", 3), False) is_equal(is_repeated_k_times("", 2), False)
MCQ
3 Unit Assessment

Reference-only archive item

The completed export preserved the prompt as an image but not a reusable answer key. The reconstruction below is for study, not scoring.

Study reconstruction
def is_repeated_k_times(s, k):
    if not s or k <= 0 or len(s) % k != 0:
        return False
    size = len(s) // k
    return s == s[:size] * k
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.