Algorithm · Salesforce · Medium
Problem 1: In-place character-run compression Given an array chars where each element is a one-character string, modify it in place so that every maximal consecutive block of identical characters is replaced by one copy of that character. If the block length is greater than 1, write the decimal representation of that length immediately afterward, putting each digit in its own separate position. The compressed data must occupy the beginning of chars. Return the number of…
Checking your access…