[AtCoder] C - Reorder CardsRead more
[AtCoder] D - Coprime 2Read more
[AtCoder] B - SquaresRead more
[AtCoder] A - Dial UpRead more
[Codeforces] Round #570 (Div. 3) C. Computer GameRead more
[Codeforces] Round #570 (Div. 3) D. Candy Box (easy version)Read more
[Codeforces] Helvetic Coding Contest 2019 online mirror (teams allowed, unrated) B1. The Doctor Meets Vader (Easy)Read more
[Codeforces] Round #572 (Div. 2) C. Candies!Read more
[AtCoder] Round #573 (Div. 1) A. Tokitsukaze and Discard ItemsRead more
[LeetCode] Minimum Deletions to Make String Balanced

1653. Minimum Deletions to Make String Balanced

You are given a string s consisting only of characters ‘a’ and ‘b’​​​​.

You can delete any number of characters in s to make s balanced. s is balanced if there is no pair of indices (i,j) such that i < j and s[i] = ‘b’ and s[j]= ‘a’.

Return the minimum number of deletions needed to make s balanced.

Read more