The problem goes as follows : "An array a is called beautiful if for every pair of numbers ai, aj, (i ≠ j), there exists an ak such that ak = ai * aj. Note that k can be equal to i or j too." So for n==1, there do not exist any pairs and hence the array is not supposed to be "Beautiful". But the way test cases turned out, the array was supposed to be "Not Beautiful" Kindly check into it the same.
↧