{"ScriptPreparationCode":null,"TestCases":[{"Name":"testbst","Code":"function findSum(arr,value){\r\n let idx1 = 0\r\n let idx2 = arr.length - 1\r\n arr.sort((a,b) =\u003E a-b)\r\n while(idx2 != idx1){\r\n console.log(idx2,idx1)\r\n if (arr[idx2] \u002B arr[idx1] \u003E value){\r\n idx2--\r\n } else if (arr[idx2] \u002B arr[idx1] \u003C value) {\r\n idx1\u002B\u002B\r\n } else {\r\n return [arr[idx2],arr[idx1]]\r\n }\r\n }\r\n return false\r\n}\r\n\r\nfindSum([1,21,3,14,5,60,7,6],81)","IsDeferred":false},{"Name":"testbrute","Code":"function findSum(arr,value){\r\n for (let val of arr){\r\n if (arr.includes(value - val)) return [val,value-val]\r\n }\r\n return false\r\n}\r\nfindSum([1,21,3,14,5,60,7,6],81)","IsDeferred":false}]}