← All problemsSign in

MAKE THEM EQUAL

Sanjay always believe in EQUALITY. He always want to make everything equal. Now he got a problem that he has a m*n 2D number matrix and an integer X. In one operation, he can add X or subtract X from any element in the matrix. He wants to make all elements in the matrix equal to a certain value by performing the above operation any no of times and returns the count of operations ,if he is not abl

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