Max Lucky Numbers

Problem Overview

  • Determine the maximum lucky number formed only with digits x and y whose digits sum to n.
  • Inputs: digits x and y, and sum n; Output: the maximum lucky number as an integer.
  • A lucky number contains only x and y; at least one valid number is guaranteed.
  • Context: Amazon coupon lottery scenario.
  • This interview question from Amazon interviews is a coding interview problem.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: