← All problemsSign in

Validation of String

You will be given a string 's'. The task is to find the validity of string 's' and print 'YES' if it is valid, otherwise print 'NO'. The string 's' is valid in the following two cases. - All characters in the string should occur same number of times. For example s = "xxyyzz" is valid, but s = "wxxyyz" is not valid. - Deleting exactly 1 character from s will result in all its characters occurri

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