Check out example codes for "poosible two pairs of a number". It will help you in understanding the concepts better.

Code Example 1

2
1
8

Code Example 2

0 1
5 3

Learn ReactJs, React Native from akashmittal.com