Merge branch 'fibonacci'

This commit is contained in:
Carlos cristovao guerreiro scantbelruy 2022-10-28 13:48:37 -04:00
commit 60e0bc9b84
4 changed files with 30 additions and 10 deletions

View File

@ -1,4 +1,6 @@
export function fibonacci(value) {
// implementar logica aqui
if(value < 2) {
return value
}
return fibonacci(value - 1) + fibonacci(value - 2)
}

View File

@ -1,4 +1,8 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
if (word1.length !== word2.length) {
return false;
}
if (word1.length === word2.length) {
return true;
}
}

View File

@ -1,4 +1,15 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
let h = new Set();
for(let i = 1; i <= text.length - 1; i++)
{
let c = text[i];
if (h.has(c))
return c;
else
h.add(c);
}
return '\0';
}

View File

@ -1,4 +1,7 @@
export function longestWords(words) {
// implementar logica aqui
var longest = "";
for (var word of words) {
if (words.length > longest.length) longest = words;
}
return longest;
}