LeetCode #3754

Concatenate Non-Zero Digits and Multiply by Sum I

1개의 풀이 · Python

문제 원문 보기 ↗

SOLUTION INFO

Python · main.py

main.py
from functools import reduce

class Solution:
    def sumAndMultiply(self, n: int) -> int:
        s = list(
            filter(
                lambda x: x != 0, list(map(int, list(str(n))))
            )
        )
        return sum(s) * int(''.join(map(str, s))) if s else 0

SOLUTION DESCRIPTION

풀이 설명

등록된 풀이 설명이 없습니다.