In Python,using custom sort,concatenate array elements such that the result will be greatest value from those elements.
T = int(input("Enter number of test cases: "))
for _ in range(T):
N = int(input())
array = list(map(int, input().split()))
array = list(map(str, array))
array.sort(key=lambda x: (x * 3), reverse=True if '0' in array else False)
largest_num = ''.join(array)
print(largest_num)
# it is not solving for all test cases.