From bf0990022c719d101a6e5c8174e22610cadce66d Mon Sep 17 00:00:00 2001 From: samiadrabeea <76263635+samiadrabeea@users.noreply.github.com> Date: Thu, 4 Feb 2021 03:20:24 +0300 Subject: [PATCH 1/3] solve first Toy Problem add minimum function --- firstToyProblem.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/firstToyProblem.js b/firstToyProblem.js index b0873e7..856dc03 100644 --- a/firstToyProblem.js +++ b/firstToyProblem.js @@ -1,9 +1,9 @@ -/** - * [1,10,5,-3,100] - * create a function that finds the minimum - * without using any pre build in function - */ - -function minimum(array) { - return; -} +/** + * [1,10,5,-3,100] + * create a function that finds the minimum + * without using any pre build in function + */ + +function minimum(array) { + return; +} From afac542fda4e8fa1c0a245749c43b8cd1c3833cf Mon Sep 17 00:00:00 2001 From: samiadrabeea <76263635+samiadrabeea@users.noreply.github.com> Date: Thu, 4 Feb 2021 03:33:41 +0300 Subject: [PATCH 2/3] solve First Toy Problem Add minimum Function --- firstToyProblem.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/firstToyProblem.js b/firstToyProblem.js index 856dc03..b1646cf 100644 --- a/firstToyProblem.js +++ b/firstToyProblem.js @@ -5,5 +5,14 @@ */ function minimum(array) { - return; + var min= array[0]; + for (let i=1; i Date: Fri, 5 Feb 2021 23:59:33 +0300 Subject: [PATCH 3/3] solve the second toy problem add sum of pair number in arrays --- sumOfPairNumber.js | 59 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sumOfPairNumber.js diff --git a/sumOfPairNumber.js b/sumOfPairNumber.js new file mode 100644 index 0000000..e02620e --- /dev/null +++ b/sumOfPairNumber.js @@ -0,0 +1,59 @@ +/** + * write a function that returns the sum of the pair numbers inside an array + * + * exple sumPair([1,6,100,346,761,249])=>452 + * + * sumPair([2,4,9,73])=>6 + */ +function sumPair(array) { + //your code goes here + if (Array.isArray(list)) + { + var sum=0; + for (let i=0; i "a & c have pair values" + * + */