Tap here to switch tabs
Problem
Submissions

Problem: Concatenate Non-Zero Digits and Multiply by Sum I

Concatenate Non-Zero Digits and Multiply by Sum I asks you to join an integer's nonzero digits in order, then return the resulting value times its digit sum, using zero when none remain.

Statement

You are given an integer n.

Form an integer x by concatenating all digits of n that are not equal to 00, preserving their original relative order. If n has no digits other than 00, then x is equal to 00.

Let sum be the sum of all digits in x.

Return the product of x and sum.

Constraints:

  • 0≤0 \leq n ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Concatenate Non-Zero Digits and Multiply by Sum I

Concatenate Non-Zero Digits and Multiply by Sum I asks you to join an integer's nonzero digits in order, then return the resulting value times its digit sum, using zero when none remain.

Statement

You are given an integer n.

Form an integer x by concatenating all digits of n that are not equal to 00, preserving their original relative order. If n has no digits other than 00, then x is equal to 00.

Let sum be the sum of all digits in x.

Return the product of x and sum.

Constraints:

  • 0≤0 \leq n ≤109\leq 10^9