← All problemsSign in

3853. Merge Close Characters

LeetCodeHash TableStringOpen on judge ↗

You are given a string s consisting of lowercase English letters and an integer k. Two equal characters in the current string s are considered close if the distance between their indices is at most k. When two characters are close, the right one merges into the left. Merges happen one at a time, and after each merge, the string updates until no more merges are possible. Return the resulting str

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