Minimum Steps to Make Two Halves Anagram (Numeric String)

Problem

Given a string s consisting only of digit characters (0-9).

  1. If the length of s is odd, return -1.
  2. Otherwise, split s into two equal halves:
    • a = s[0 : n/2]
    • `b = ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: