Available question text
Given a binary string, repeatedly apply the local rewrite rules "00" -> "10" and "10" -> "01" to produce the largest possible binary number (by decimal value); compute that maximum string. The challenge is to reason about how these local moves shift and merge zeros so you can derive the unique optimal arrangement efficiently for lengths up to 1e5.
Related questions
Continue with questions that share topics or the same question type.
- Maximum Score After Splitting a String
Coding
- Binary String With Substrings Representing 1 To N
Coding
- Binary Tree Maximum Path Sum
Coding · Binary Tree · Depth-First Search · DP on Trees
- Change the Root of a Binary Tree
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1702. Maximum Binary String After Change
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source