Back to Browse

Make the string great - Leetcode 1544 - Java

46 views
Apr 11, 2024
12:05

🧩 *PROBLEM DESCRIPTION* Given a string `s` of lower and upper case English letters. A good string is a string which doesn't have **two adjacent characters** `s[i]` and `s[i + 1]` where: - `0 <= i <= s.length - 2` - `s[i]` is a lower-case letter and `s[i + 1]` is the same letter but in upper-case or **vice-versa**. To make the string good, you can choose **two adjacent** characters that make the string bad and remove them. You can keep doing this until the string becomes good. Return _the string_ after making it good. The answer is guaranteed to be unique under the given constraints. **Notice** that an empty string is also good. ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 🔗 *LINKS* ⭐Problem: https://leetcode.com/problems/make-the-string-great/ 💻Code: https://k5kc.com/cs/problems/make-the-string-great/ ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 📂 *RELATED PLAYLISTS To Explore* 📚 Stack Data Structure: https://www.youtube.com/playlist?list=PLB53ggSrd6qkVc2unL_xP1iVUC2I1hZyT 🔤 String Datastructure: https://www.youtube.com/playlist?list=PLB53ggSrd6qkQWiNs58TAPorNIvYQlfy_ 🟢 Easy Coding Problems: https://www.youtube.com/playlist?list=PLB53ggSrd6qlIa5z85qXrwS2J0s8xBY0u ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 🔔 _SUPPORT AND SUBSCRIBE_ Don’t forget to **like**, **subscribe**, and **comment** for more problem-solving content! 🚀 🎯 _Follow me for updates_: GitHub: https://github.com/kinshuk4 Twitter: https://x.com/k5kc_ Instagram: https://www.instagram.com/_k5kc_/ LinkedIn: https://www.linkedin.com/company/k5kc/

Download

0 formats

No download links available.

Make the string great - Leetcode 1544 - Java | NatokHD