Find an element that when subtracted from each of the lements in an array add to zero
Answers
Answered by
0
Given an Array, three operations can be performed using any external number x.
Add x to an element once
Subtract x from an element once
Perform no operation on the element
Find whether there exists a number X, such that if the above operations are performed with the number X, the resulting array has equal elements.
If the number exists, print “YES” and the value, space separated, else print “NO”
Add x to an element once
Subtract x from an element once
Perform no operation on the element
Find whether there exists a number X, such that if the above operations are performed with the number X, the resulting array has equal elements.
If the number exists, print “YES” and the value, space separated, else print “NO”
Similar questions