** Examples :**

Input:lst = [1, 5, 3, 7, 9] K = 12Output: [(5, 7), (3, 9)]Input:lst = [2, 1, 5, 7, -1, 4] K = 6Output: [(2, 4), (1, 5), (7, -1)]

** Method # 1: ** Pythonic Naive

This is a naive approach to the above problem. First, we take an empty list & # 39; res & # 39; and start the loop and loop through each element of the given list of integers. At each iteration, extract the element, store it in “num”, find the remaining difference for the sum K and check if there is a difference in the given list or not.

```
``` |

** Exit:**

[(5, 7) , (3, 9)]

** Method # 2: ** Using `collections.Counter`

This approach follows the same method as which was discussed above using ` collections.Counter `

.

** Exit:**

[(5, 7), (3, 9)]

** Method # 3: ** ` itertools.combinations `

(Naive Method)

This is a naive approach to using ` itertools.combinations `

. We use a for loop to go through each combination and find the one we want.

```
``` |

```
``` |

** Exit: **

[(5, 7), (3, 9)]

** Method # 4: ** ` itertools.combinations `

(effective method)

```
``` |

** Exit:**

[(5, 7), (3, 9)]

X
# Submit new EBook