Minimum Number of Changes to Make Binary String Beautiful | Leetcode 2914

preview_player
Показать описание
This video explains finding Minimum Number of Changes to Make Binary String Beautiful with most optimal two pointer approach.
----------------------------------------------------------------------------------------------------------------------------------------------------------------
🟣 JOIN our 𝐋𝐈𝐕𝐄 𝐢𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐭𝐫𝐚𝐢𝐧𝐢𝐧𝐠 𝐩𝐫𝐨𝐠𝐫𝐚𝐦 through whatsapp query: +91 8918633037
---------------------------------------------------------------------------------------------------------------------------------------------------------------

Рекомендации по теме
Комментарии
Автор

its seems easy but kind of tricky

was able to pass 119 test cases by my own

Thank you for the explaination :)

sailendrachettri
Автор

here is an simple python code for the same:
count=0
for i in range(1, len(s), 2)):
if s[i]!=s[i-1]:
count+=1
return count


ofc clear the indentation coz its tough to align them out here

roshank.r.
Автор

Guys, I could use some advice. I solved this problem with top-down DP (so recursion + memoization) and I get TLE (time limit exceeded). I thought top-down and bottom-up approaches have similar time complexity? Is it anybody else having these issues? I swear my top-down DP solutions usually get TLE when I submit on Leetcode.

vitruvius
Автор

how one can develop approach or logic and implement towards the problem solving in dsa

imakshith
visit shbcf.ru