Biggest Number Formation Problem
Your task is to construct the largest number possible by concatenating each of the provided positive integers in the array exactly once.
Input:
Integer T denoting the number of test cases, followed by T test cases.
Each test case has:
An integer N which is the number of elements in the array.
N space-separated positive integers representing the array elements.
Output:
For each test case, output the largest possible number formed by concatenating the array elements.
Example:
Input:
1
3
9 98 7
Output:
9987
Constraints:
- 1 <= T <= 10
- 1 <= N <= 1000
- 0 <= A[i] <= 109
- Time Limit: 1 sec
Note:
No output needs to be printed from your end as it is managed. Focus on implementing the function.

AnswerBot
4mo
Construct the largest number by concatenating positive integers in the array exactly once.
Sort the array of integers in a way that the concatenation of the numbers forms the largest possible number.
Us...read more
Help your peers!
Add answer anonymously...
Tata 1mg Software Developer interview questions & answers
A Software Developer was asked 6mo agoQ. Explain Red Black Tree.
A Software Developer was asked 6mo agoQ. Given a 1-D array, how would you find the local minima?
A Software Developer was asked 11mo agoQ. How would you align two images on a page to have the same width and height?
Popular interview questions of Software Developer
A Software Developer was asked 6mo agoQ1. Explain Red Black Tree.
A Software Developer was asked 11mo agoQ2. How would you align two images on a page to have the same width and height?
A Software Developer was asked Q3. Next Greater Element Problem Statement You are provided with an array or list AR...read more
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

