String Compression at Salesforce
Medium59.5% acceptance
This problem has 87.5% frequency at Salesforce.
Problem Description
Given an array of characters `chars`, compress it using the following algorithm: Begin with an empty string `s`. For each group of **consecutive repeating characters** in `chars`: * If the group's length is `1`, append the character to `s`. * Otherwise, append the character followed by the gro...
Read full problem and hintsTopics
Also asked at 42 companies
More Salesforce Questions
Remove Adjacent Almost-Equal CharactersMediumMaximum Number of Occurrences of a SubstringMediumSmallest Substring With Identical Characters IIHardTime Needed to Rearrange a Binary StringMediumLongest Substring Without Repeating CharactersMedium
View all Salesforce questions