Replace Digit
Asked at Microsoft · Coding & Leetcode-style Questions · Difficulty: Medium
There is a string **S** representing a positive number consisting of N digits. In one move, you can choose some digit of **S** that is not equal to 5 and replace it with the digit 5. What is the maximum number that can be obtained after making exactly **K** moves?
Loading the problem…
More Microsoft interview questions
- LLM conceptual questions
- Transformer Roofline and FP32→FP16 Drill
- Tiny Next-Token Prediction Model (PyTorch Fill-In)
- DNA Shotgun Sequencing: Chain and Eulerian Path Reconstruction
- Design Search Autocomplete / Typeahead
- Design a Chatbot Personalization / Memory System