Friday, May 9, 2025
Latest:
  • Der kleine Vogel und die Sonne
  • German alphabet pronunciation
  • Command design pattern
  • German words with gender
  • When to use einen and keinen in German?
Upokary

Upokary

Quality information

  • Health
  • Life
  • Fashion
  • Food
  • Code
  • English
  • বাংলা
Technology 

Find if the sum of two integers is equal to the given value

Published: February 10, 2022
   const verifySum = (arr, total) => {
       for(let i = 0; i < arr.length ; i++ ){
           for(let j = 0 ; j < arr.length; j++) {
               if (i === j) {
                   continue;
               }

               if(total === arr[i] + arr[j]) {
                   return true;
               }
           }
       }
       return false;
   }

   const input = [5, 7, 1, 2, 8, 4, 3];
   console.log(verifySum(input, 15));

You May Also Like

Obey the general contract when overriding equals in Java

February 6, 2020 beroza

java.lang.IllegalStateException: Failed to load ApplicationContext

November 28, 2019 beroza

Find total number of Sundays, Saturdays between two dates in JavaScript

December 22, 2018 beroza

Can’t define property object not extensible

September 11, 2021 beroza

What are differences between “mvn clean package” and “mvn clean install” in maven?

March 7, 2019 beroza

How to read the logs inside a pod?

January 19, 2024 beroza

How to install composer in Mac OSX?

November 13, 2019 beroza

What are the differences between Map vs Object in JavaScript?

August 30, 2021 beroza

Webpack related important links

August 11, 2022 beroza

Why Upokary?

Upokary.com is a useful application in everyday life. It provides very handy information regarding every aspect of life. Each and every tip of upokary.com is meant to make life better.

Upokary tools

  • Youtube thumbnail
  • Youtube video downloader

Useful Links

  • Handy code
  • Technology
  • People
  • Programming
  • Quote
  • Travel
  • WordPress
  • IELTS
  • Kids

Languages

  • EnglishEnglish
  • বাংলাবাংলা

Pages

  • Sitemap
  • Privacy policy
  • About us
  • Contact us

Support

For any kind of query or question please drop a message in the following email: upokary@gmail.com
Copyright © 2025 Upokary. All rights reserved.