Concatenate the Largest Digit Problem

You are given three non-zero numbers 'A', 'B', and 'C'. Your task is to determine the number created by concatenating the largest digit found in each number, in the sequence of 'A', 'B', and 'C'.

Example:

Input:
A = 5678, B = 45, C = 769
Output:
859
Explanation:

The largest digit in 'A' is '8', in 'B' is '5', and in 'C' is '9'. Concatenating these gives '859'.

Constraints:

  • 1 ≤ T ≤ 104
  • 1 ≤ A, B, C ≤ 106
  • Time limit: 1 Sec
AnswerBot
2d

Concatenate the largest digit from three numbers in sequence to form a new number.

  • Find the largest digit in each number 'A', 'B', and 'C'.

  • Concatenate the largest digits in the sequence 'A', 'B', and '...read more

Help your peers!
Add answer anonymously...
TAAZAA Associate Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter