Practice Maximum Product of Two Digits
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given a positive integer n. Return the maximum product of any two digits in n. Note: You may use the same digit twice if it appears more than once in n.
Source: Maximum Product of Two Digits on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
Input
n = 31
Output
3
# Example 2
Input
n = 22
Output
4
# Example 3
Input
n = 124
Output
8
Constraints
10 <= n <= 10^9
Related LeetCode Problems
Practice more problems similar to Maximum Product of Two Digits.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.