← All problemsSign in

2998. Minimum Number of Operations to Make X and Y Equal

LeetCodeDynamic ProgrammingBreadth-First SearchMemoizationOpen on judge ↗

You are given two positive integers x and y. In one operation, you can do one of the four following operations: - Divide x by 11 if x is a multiple of 11. - Divide x by 5 if x is a multiple of 5. - Decrement x by 1. - Increment x by 1. Return the minimum number of operations required to make x and y equal. Example 1: Input: x = 26, y = 1 Output: 3 Explanation: We can make 26 equal to 1 b

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