All Tracks Data Structures Arrays 1-D Problem

Monk and Lucky Minimum
/

Data Structures, One-dimensional, approved

Problem
Editorial
Analytics

Monk just purchased an array A having N integers. Monk is very superstitious. He calls the array A Lucky if the frequency of the minimum element is odd, otherwise he considers it Unlucky. Help Monk in finding out if the array is Lucky or not.

Input:
First line consists of a single integer T denoting the number of test cases.
First line of each test case consists of a single integer N denoting the size of array A.
Second line of each test case consists of N space separated integers denoting the array A.

Output:
For each test case, print "Lucky" (without quotes) if frequency of minimum element is odd, otherwise print "Unlucky"(without quotes). Print a new line after each test case.

Constraints:
\(1 \le T \le 10\)
\(1 \le N \le 10^5\)
\(1 \le A[i] \le 10^9\)

SAMPLE INPUT
2
5
8 8 9 5 9
5
3 3 3 5 3
SAMPLE OUTPUT
Lucky
Unlucky
Explanation

In first case, value of minimum element is 5 and it's frequency is 1 which is odd, so the array is Lucky.
In second case, value of minimum element is 3 and it's frequency is 4 which is even, so the array is Unlucky.

Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB

Best Submission

Similar Problems

Contributors

This Problem was Asked in

Initializing Code Editor...
Notifications
View All Notifications

?