상위 150개 인터뷰쉬움

문자열 곱하기

'Multiply Strings' 문제에 대한 자세한 가이드 및 Python 구현입니다.

문제 설명

쉬움

문자열로 표현된 두 개의 음수가 아닌 정수 num1과 num2가 주어지면 문자열로 표현된 num1과 num2의 곱을 반환합니다.

참고: 내장된 BigInteger 라이브러리를 사용하거나 입력을 정수로 직접 변환하면 안 됩니다.

multiply(num1: str, num2: str) -> str 함수를 구현하세요.

제약
  • 1 <= num1.length, num2.length <= 200
  • num1 and num2 consist of digits only
  • Both num1 and num2 do not contain any leading zero, except the number 0 itself

Example 1
Input
"2", "3"
Output
"6"
Explanation

2 * 3 = 6.

Example 2
Input
"123", "456"
Output
"56088"
Explanation

123 * 456 = 56088.

Need a Hint?
세트나 힙과 같은 수학 및 기하학 관련 데이터 구조를 사용해 보세요.
Edge Cases to Watch
  • 빈 입력 구조
  • 단일 요소 입력
  • 큰 수치 범위

해결할 준비가 되셨나요?

Open the problem in PyRun's browser-based Python editor. Your code runs fully offline — no server required.

편집기에서 열기
Found this breakdown helpful?

PyRun is built and maintained by an independent solo developer. If this helped your interview prep, consider buying a coffee!

Buy me a coffee

권장 Python 리소스

관련 대화형 튜토리얼, 치트 시트, 코드 비교를 통해 지식을 확장하세요.