Given a list of strings A, find the longest common prefix among all the strings.
A: [“abc”, “abef”, “abccc”, “abftg”]
Longest common prefix: “ab”
The first line contains an integer ‘T’ denoting the number of test cases.
For each test case, the input has two lines:
For each test case, the output has one line with a string denoting the longest common prefix.
4
4
apple apply apollo abracadabra
2
qwerty hello
3
helloworld hell hello
1
hello
a
hell
hello
1 <= T <= 10
1 <= n <= 100
1 <= Ai size <= 1000