Tap here to switch tabs
Problem
Submissions

Problem: Check if String Splits Into Value-Equal Substrings

Try to solve the Check if String Splits Into Value-Equal Substrings problem.

Statement

Given a string s consisting of digits, determine if s can be partitioned into consecutive value equal substrings such that:

  • Exactly one substring has a length of 22.

  • All other substrings have a length of 33.

A substring is considered value equal if every character within it is identical.

Return true if s can be decomposed under these conditions, or false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s consists only of digits ′0′'0' through ′9′'9'.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check if String Splits Into Value-Equal Substrings

Try to solve the Check if String Splits Into Value-Equal Substrings problem.

Statement

Given a string s consisting of digits, determine if s can be partitioned into consecutive value equal substrings such that:

  • Exactly one substring has a length of 22.

  • All other substrings have a length of 33.

A substring is considered value equal if every character within it is identical.

Return true if s can be decomposed under these conditions, or false otherwise.

Constraints:

  • 1≤1 \leq s.length ≤1000\leq 1000

  • s consists only of digits ′0′'0' through ′9′'9'.