- Think in a two-digit number.
- Subtract by it's digits sum. Ex.: 13 - (1 + 3).
- Sum it's digits. Ex.: 13 => 1 + 3.
- Sum by 4.
- Multiply by it's reversed digits number. Ex.: 31 * 13.
- Multiply by 3.
- Should be equal 1209.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Show Me the Evens - Show me the Odds | |
| * Diana is learning to count and she just learned the difference between odds and even numbers. | |
| * She wants to have some fun, so she picks a random number. | |
| * If that number is even, she decides to count all the even numbers up to it starting from 0 up to (but not including) the input. | |
| * If not, she decides to count all the odd numbers up to that number starting from 1 (but not including) the input. | |
| **/ | |
| const | |
| range = x => y => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Show Me the Evens - Show me the Odds | |
| * Diana is learning to count and she just learned the difference between odds and even numbers. | |
| * She wants to have some fun, so she picks a random number. | |
| * If that number is even, she decides to count all the even numbers up to it starting from 0 up to (but not including) the input. | |
| * If not, she decides to count all the odd numbers up to that number starting from 1 (but not including) the input. | |
| **/ | |
| function counting(x){ | |
| return [...Array(x).keys()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const | |
| composeN = (...fs) => y => | |
| fs.reduceRight((x, f) => f(x), y) | |
| , flatten = xs => | |
| xs.reduce((acc, x) => acc.concat(x)) | |
| , filter = pred => xs => | |
| xs.filter(pred) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const | |
| composeN = (...fs) => y => | |
| fs.reduceRight((x, f) => f(x), y) | |
| , concat = ys => xs => | |
| xs.concat(ys) | |
| , flatten = xs => | |
| reduce(uncurry2(concat))(xs) |
-
Pense em qualquer número de DOIS dígitos, por exemplo 47
-
Subtraia a soma dos algarismos. Ex.: 47 - (4 + 7) = 36
-
Depois some os algarismos resultantes da subtração anterior, adicionando 4. Ex.: 3 + 6 + 4 = 13
-
Multiplique o resultado pelo inverso do número. Ex.: 13 x 31 = 403
-
E por último, multiplique por 3 o resultado anterior. Ex. 403 x 3 = 1209
-
Obs.: Qualquer número de 2 algarismos (entre 10 e 99) terão o mesmo resultado.
-
Não acredita ? Faça o teste !!!!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| crie uma função chamada MaiorPalavra(str) que recebe um parâmetro do tipo string e retorna a maior palavra. | |
| tenha como casos de entrada os exemplos abaixo: | |
| "Olá mundo" | |
| "Letra após letra" | |
| "uma confusa /:cadeia de caracteres:/[ isso não é!!!!!!!~" | |
| "uma bonita sequência^&" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Transformar uma string em outra na qual cada letra do alfabeto deve ser a proxima mantendo o resto igual. ex: a -> b, z -> a, f -> g. | |
| Após a transformação gerar uma nova string onde toda vogal deve ser maiúscula. | |
| exemplos: | |
| Input:"hello*3" | |
| Output:"Ifmmp*3" | |
| Input:"fun times!" |
OlderNewer