Back to problems

String Path Compression

Algorithm · Stripe · Medium

Problem Overview You receive a path-style string: / separates the top-level components, while . divides the smaller components inside each top-level component. Build a compression process with two stages. The task advances through these two parts: Part 1 — Compress each minor component: turn every minor component into first_char + middle_count + last_char (for example, planet becomes p4t). Keep both / separators and . separators in their original structural roles. Part 2 —…

Checking your access…