TURBOLAB Hiring | Off-Campus OA (2024) | Maximum Value After Insertion
Question · Posted Jun 2026
Problem: Maximum Value After Insertion Given a string n representing an integer and an integer digit x, insert x anywhere in n such that: If n is positive, the resulting number is maximized. If n is negative, the resulting number is minimized (more negative). Return the resulting number as a string. Example Example 1 Input n = "99" x = 9 Output "999" Example 2 Input n = "73" x = 6 Output "763"
The full answer & interview discussion are available to premium members.
Log in Create a free account