Загрузка...

String Compression III - Leetcode 3163 - Java

Problem Description

Given a string word, compress it using the following algorithm:

Begin with an empty string comp. While word is not empty, use the following operation:
Remove a maximum length prefix of word made of a single character c repeating at most 9 times.
Append the length of the prefix followed by c to comp.
Return the string comp.

Problem: https://leetcode.com/problems/string-compression-iii/
Code link: https://k5kc.com/cs/problems/string-compression-3/

Видео String Compression III - Leetcode 3163 - Java канала Code With K5KC
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять