From 1818f4fd9548696eb7489c32e07bfc0e8b3a8e2c Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 28 Oct 2022 16:27:30 -0300 Subject: [PATCH 01/10] feat(greeting): adicionando a logica da funcao --- 01-greeting/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01-greeting/index.js b/01-greeting/index.js index 8f551af..5c0279c 100644 --- a/01-greeting/index.js +++ b/01-greeting/index.js @@ -1,4 +1,4 @@ export function greet(name) { // implementar logica aqui - return ""; + return `Hello ${name}`; } From 36734fcdb03a430a4befd5ee03b4bda963be2aa4 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 28 Oct 2022 16:29:12 -0300 Subject: [PATCH 02/10] feat(triangleArea): adicionando a logica da funcao --- 02-triangleArea/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/02-triangleArea/index.js b/02-triangleArea/index.js index 7628fcd..afa1a0f 100644 --- a/02-triangleArea/index.js +++ b/02-triangleArea/index.js @@ -1,3 +1,4 @@ export function triangleArea(base, height) { // your code here + return base*height/2; } \ No newline at end of file From a2939d24e2a196e4749f964fa08c41fa0ec6a402 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 28 Oct 2022 16:31:29 -0300 Subject: [PATCH 03/10] feat(maxValue): adicionando a logica da funcao --- 03-maxValue/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/03-maxValue/index.js b/03-maxValue/index.js index e433b31..aad51b1 100644 --- a/03-maxValue/index.js +++ b/03-maxValue/index.js @@ -1,4 +1,14 @@ export function maxValue(values) { // implementar logica aqui + let maxV = values[0] + for(let i = 1; i < values.length; i++) { + if(maxV < values[i]){ + maxV = values[i] + } + } + if(values.length == 0) + return 0; + + return maxV; } \ No newline at end of file From 40c3f7c8381118a22fcf5c65b5cfa7c8a1c13363 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 28 Oct 2022 16:33:01 -0300 Subject: [PATCH 04/10] feat(fibonacci): adicionando a logica da funcao --- 04-fibonacci/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/04-fibonacci/index.js b/04-fibonacci/index.js index 37c64cc..f703f11 100644 --- a/04-fibonacci/index.js +++ b/04-fibonacci/index.js @@ -1,4 +1,8 @@ export function fibonacci(value) { // implementar logica aqui - + const arr = [0, 1] + for(let i = 1; i Date: Fri, 28 Oct 2022 16:37:19 -0300 Subject: [PATCH 05/10] feat(isPrime): adicionando a logica da funcao --- 05-isPrime/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/05-isPrime/index.js b/05-isPrime/index.js index ec9c4ac..75610cc 100644 --- a/05-isPrime/index.js +++ b/05-isPrime/index.js @@ -1,4 +1,12 @@ export function isPrime(value) { // implementar logica aqui + for(let i = 2; i < value; i++){ + if(value%i === 0){ + return false + } + } + if(value === 1) + return false + return true } \ No newline at end of file From d3dd9f76efeea9e0e7b75685ffa77d2109e06275 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 28 Oct 2022 16:38:58 -0300 Subject: [PATCH 06/10] feat(sum): adicionando a logica da funcao --- 06-sum/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/06-sum/index.js b/06-sum/index.js index ebc2ee1..cdfd3e7 100644 --- a/06-sum/index.js +++ b/06-sum/index.js @@ -1,4 +1,8 @@ export function sum(values) { // implementar logica aqui - + let soma = 0 + for(let i = 0; i Date: Fri, 28 Oct 2022 16:40:53 -0300 Subject: [PATCH 07/10] feat(sumEven): adicionando a logica da funcao --- 07-sumEven/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/07-sumEven/index.js b/07-sumEven/index.js index bb1e095..c0259a3 100644 --- a/07-sumEven/index.js +++ b/07-sumEven/index.js @@ -1,4 +1,9 @@ export function sumEven(value) { // implementar logica aqui - + let soma = 0 + for(let i = 0; i Date: Fri, 28 Oct 2022 16:42:17 -0300 Subject: [PATCH 08/10] feat(isAnagram): adicionando a logica da funcao --- 08-isAnagram/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/08-isAnagram/index.js b/08-isAnagram/index.js index 918308a..ccbb3c0 100644 --- a/08-isAnagram/index.js +++ b/08-isAnagram/index.js @@ -1,4 +1,4 @@ export function isAnagram(word1, word2) { // implementar logica aqui - + return word1.toLowerCase().split('').sort().join("") == word2.toLowerCase().split('').sort().join("") } \ No newline at end of file From 3fb46fd7fd3af2e35a7e9e3a03671f810d239740 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 28 Oct 2022 16:44:27 -0300 Subject: [PATCH 09/10] feat(mostRepeatedChar): adicionando a logica da funcao --- 09-mostRepeatedChar/index.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/09-mostRepeatedChar/index.js b/09-mostRepeatedChar/index.js index b113ed8..a770fcd 100644 --- a/09-mostRepeatedChar/index.js +++ b/09-mostRepeatedChar/index.js @@ -1,4 +1,23 @@ export function mostUsedChar(text) { // implementar logica aqui - return "" + let caracMax + let qtdd = 0 + let qtdd2 = 0 + + for(let i = 0; i < text.length; i++){ + for(let j = 0; j < text.length; j++){ + if(text[i] == text[j]){ + qtdd2 = qtdd2 + 1 + } + } + + if(qtdd2 > qtdd){ + caracMax = text[i] + qtdd = qtdd2 + } + + qtdd2 = 0 + } + + return caracMax } \ No newline at end of file From 2f25240d361428ff14ddb2078a5640524ba872f0 Mon Sep 17 00:00:00 2001 From: Guilherme Date: Fri, 28 Oct 2022 16:46:34 -0300 Subject: [PATCH 10/10] feat(longestWords): adicionando a logica da funcao --- 10-longestWords/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/10-longestWords/index.js b/10-longestWords/index.js index a98d2d8..4e589e7 100644 --- a/10-longestWords/index.js +++ b/10-longestWords/index.js @@ -1,4 +1,13 @@ export function longestWords(words) { // implementar logica aqui - + let arr = ['']; + + for(let i = 0; i < words.length; i++){ + if(words[i].length > arr[0].length){ + arr = [words[i]]; + }else if(words[i].length == arr[0].length){ + arr.push(words[i]); + } + } + return arr; } \ No newline at end of file