Quick Overview

Given a digit string containing at least one 5, delete exactly one 5 so the remaining string has the largest possible numeric value, keeping any leading zeros. This intern online-assessment problem tests reasoning about how each digit position affects a number and careful handling of repeated digits.

Delete One '5' From a Digit String to Get the Largest Number

Company: Cohere

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Onsite

Overview: Given a digit string containing at least one 5, delete exactly one 5 so the remaining string has the largest possible numeric value, keeping any leading zeros. This intern online-assessment problem tests reasoning about how each digit position affects a number and careful handling of repeated digits.

Loading…