← Questions
Delete one '5' from a digit string to get the largest number
0
I was asked this
No reports yet. Sign in to say where you were asked it.
You get a string of decimal digits that contains at least one '5'. Remove exactly one of the '5' characters so that the number left is as large as possible, and return that string. Explain why a greedy choice of which '5' to drop is correct, and give the running time.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Sign in to submit your code; every attempt is kept here.
Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding
