← Questions

Delete one '5' from a digit string to get the largest number

0
CohereCodingLast asked Sep 2026

A coding interview question asked in Cohere's coding round, last asked Sep 2026. It tests greedy and strings.

You get a string of decimal digits that contains at least one '5'. Delete exactly one '5' so that the number left is as large as possible, and return it as a string.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Cohere · Coding · Last asked Sep 202660 min · Live coding · Reported as generally allowed; you are graded on the work, not on how you use AI

What it tests

greedy · strings

Your code and the AI tutor open when you unlock this question.