companyhub
DashboardCompaniesProblemsSheetsBookmarksRevisionsAnalyticsLeaderboardCompare
Settings
Sign in
DashboardCompaniesProblemsSheetsBookmarks
Medium

Minimum Number of Swaps to Make the String Balanced

78.0% acceptance · asked by 13 companies

Solve on LeetCode
StringTwo PointersGreedyStack

Workspace

Scratch, run, iterate — then submit on LeetCode

Custom input (stdin)

Console

Output appears here. Runs on the free Piston sandbox.

Your notes

Sign in to keep markdown notes on this problem — approach, complexity, gotchas.

Who asks this

Visa100Microstrategy75Expedia63Servicenow63Adobe
50
Zoho38
Ibm38
Paypal38
Amazon25
Google25
Microsoft25
Meta13
Bloomberg13

Related problems

Valid Parentheses
Easy
Longest Substring Without Repeating Characters
Medium
Group Anagrams
Medium
Longest Palindromic Substring
Medium
Longest Common Prefix
Easy