Remove Digit From Number to Maximize Result Problem
Remove Digit From Number to Maximize Result Problem — ExecCode Easy DSA Practice
Solve the Remove Digit From Number to Maximize Result problem on ExecCode. Free online easy DSA practice in String. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given a string number representing a positive integer and a character digit. Your task is to compute the required answer and return the resulting string after removing exactly one occurrence of digit from number such that the value of the resulting string in decimal form is maximized . The test cases are generated such that digit occurs at least once in number.
Examples
Input {"number": "123", "digit": "3"}; Output 12. Input {"number": "1231", "digit": "1"}; Output 231
Constraints
2 <= number.length <= 100 number consists of digits from '1' to '9'. digit is a digit from '1' to '9'. digit occurs at least once in number.
Practice Remove Digit From Number to Maximize Result free on ExecCode. Browse DSA problems, topic map, and placement guides.