Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

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.