2767. Partition String Into Minimum Beautiful Substrings
Given a binary string
s
, partition the string into one or more substrings such that each substring is beautiful.A string is beautiful if:
- It doesn’t contain leading zeros.
- It’s the binary representation of a number that is a power of
5
.Return the minimum number of substrings in such partition. If it is impossible to partition the string
s
into beautiful substrings, return-1
.A substring is a contiguous sequence of characters in a string.
1 | class Solution { |