Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 585 Bytes

File metadata and controls

20 lines (16 loc) · 585 Bytes

String Compression

Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every element of the array should be a character (not int) of length 1. After you are done modifying the input array in-place, return the new length of the array.

Solutions:

Swift

O(n), where n is the number of elements in matrix

C++

O(n), where n is the number of elements in matrix

Installation

Run make to build and run C++ files and run Swift files. Or you can run .playground file.