String Compression: Google & Palantir Problem {Using Pointers}

Veröffentlicht am: 04 Oktober 2021
auf dem Kanal: Chris Ibe
38
3

In this episode, we solve Cracking the Coding Interview Problem #1.6: String Compression, where we are given a strings and asked to return the compressed version where each element of the string is returned with the number of times it occurs. We solve this in O(n) linear runtime using Pointers.

Watch and enjoy.

My Other Channel:    / @disrupted572  

Top Software/ Coding Channels:
   / @csdojo  
   / kevinnaughtonjr  
   / @jomatech  
   / @techlead  

Top Python Coding Channels:
   / @neetcode  
   / @timc3406  

Twitter:   / realchrisibe  
Instagram:   / christopher_ibe  
Facebook:   / christopher.ibeekeocha  
Snapchat: @christopheribe
LinkedIn:   / christopher-ibe-ekeocha  

Problem Statement:
String Compression: Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabbcccccaaa would become a2b1c5a3. If the compressed string should not become smaller than the original string, your method should return the original string. You can assume the string has only uppercase and lowercase letters (a-z)

Hint: Do the easy thing first, compress the string, then compare the lengths. BE careful that you aren’t concatenating strings together. This can be very inefficient


Amazon Link: https://www.amazon.com/Cracking-Codin...


Auf dieser Seite können Sie das Online-Video String Compression: Google & Palantir Problem {Using Pointers} mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Chris Ibe 04 Oktober 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 38 Mal angesehen und es wurde von 3 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!