Problem 13: Non-Repeating Rearrangement of String [IBM]
String Rearranging, Data Structures, Heap
This problem was asked by IBM.
Given a string with repeated characters, rearrange the string so that no two adjacent characters are the same. If this is not possible, return None
.
For example, given "aaabbc", you could return "ababac". Given "aaab", return None
.
The solution to this problem will be shared tomorrow with the premium subscribers of the newsletter.
——————————————————————————————————————
Bonuses/Promotion (Get Free Stuff)
To get access to the solution for this problem (and high-quality breakdowns of many other problems), subscribe to the publication right here. Join various other coders nailing interviews at top-tier firms such as Facebook, Microsoft, Google, Fidelity, and more:
To learn how to interview better DM me. Let’s set up mock interviews and go over different interview techniques. In addition to focused questions, and a detailed personalized plan, we will go over the right questions to ask during your interviews.
To share interesting problems/solutions with me, reach out to me. Different social media of mine also have other content from me. Good problems and/or solutions receive a free shoutout + 2 months of the paid newsletter:
Reach out to me on Instagram: https://www.instagram.com/iseethings404/
Message me on Twitter: https://twitter.com/Machine01776819
My LinkedIn: https://www.linkedin.com/in/devansh-devansh-516004168/