Let us assume an array arr[]. We need to check if all the numbers of an array can be equalized to a particular number. In a single operation, any element of the array can be either multiplied by 2 or by 3. If it’s possible to make all the array elements equal with the given operation then print Yes else print No.
Example:nnInput:n3n50 75 100nnOutput:nYes ->{50 * 2 * 3, 75 * 2 * 2, 100 * 3} = {300, 300, 300}nnInput:n2n10 14nnOutput:nNon
To make the elements of an array all equal,
Asked in companies like Paypal.n
@@coding::1@@
Recommended Programs