Check if there exists a pair (a, b) such that for all the N pairs either of the element should be equal to either a or b
Given an array arr[] of N pairs of distinct integers, the task is to check if there exists any pair (X, Y) such that each pair of the array has at least one common element with the pair (X, Y). Examples: Input: arr[] = {{1, 2}, {2, 3}, {3, 4}, {4, 5}}Output: YesExplanation:One of the pair that satis