Sum pair algorithm in one line of python

Preface I was discussing Sum Pair problem among our friends and after few minutes, I bragged that this problem is so easy, it can be done in one line. ‘What is so confusing about it?’. Others were not convinced. I then challenged myself to write it in one line. This is how I achieved it. The problem In Sum Pair (or Pair Sum), we have to find 2 numbers in a list such that their sum is highest among all possible combinations in that list....

August 21, 2022 · 7 min · Kapil Singaria