abhishek03joshi / Misc-5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misc-5

Problems 2 : Remove all the continuous character

Given a string we have to remove all the continuous character whose count is more than 2. For example :

  1. abba ----> abba
  2. abbb---->a is the output because c count is 3.
  3. abbbaa---> '' empty string
  4. abbacccaa--->abbHere relative order of characters and their counts must be maintained so we figured out that we cannot use hashtable. Give a solution better than O(n^2).

About


Languages

Language:Java 100.0%