← All problemsSign in

2478. Number of Beautiful Partitions

LeetCodeStringDynamic ProgrammingPrefix SumOpen on judge ↗

You are given a string s that consists of the digits '1' to '9' and two integers k and minLength. A partition of s is called beautiful if: - s is partitioned into k non-intersecting substrings. - Each substring has a length of at least minLength. - Each substring starts with a prime digit and ends with a non-prime digit. Prime digits are '2', '3', '5', and '7', and the rest of the digits are n

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start