← All problemsSign in

Maximum 69 Number

You are given an integer N. Your task is to find the maximum possible number that can be obtained by changing at most K digits in N from 6 to 9, where K is a positive integer. Write a function or a program to find the maximum number after the changes and return it. ### Input A single integer N (1 ≤ N ≤ 10^18). An integer K (1 ≤ K ≤ 18), representing the maximum number of digit changes allowed.

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start