← All problemsSign in

3754. Concatenate Non-Zero Digits and Multiply by Sum I

LeetCodeMathOpen on judge ↗

You are given an integer n. Form a new integer x by concatenating all the non-zero digits of n in their original order. If there are no non-zero digits, x = 0. Let sum be the sum of digits in x. Return an integer representing the value of x * sum. Example 1: Input: n = 10203004 Output: 12340 Explanation: - The non-zero digits are 1, 2, 3, and 4. Thus, x = 1234. - The sum of digits is su

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