-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from LokoInsanus/challenges/2-palindromos/dar…
…t/lokoinsanus Finalizando desafio 2
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Submissão de Exercicio | ||
|
||
**Exercicio:** 2 - Palindromos | ||
|
||
**Nickname:** lokoinsanus | ||
|
||
**Nível Técnico:** - Estudante | ||
|
||
**Empresa:** - Nenhuma | ||
|
||
**Twitter**: https://twitter.com/lokoinsanus | ||
|
||
**Dificuldade de Resolução:** - Baixa | ||
|
||
**Como rodar o desafio**: | ||
|
||
É necessário ter o ambiente ter instalada a Dart SDK. Podendo seguir as orientações em https://dart.dev/get-dart | ||
|
||
Para compilar o código use: | ||
```bash | ||
dart palindromos.dart arara | ||
``` | ||
|
||
**Input/Args**: | ||
- arara | ||
- abacaxi | ||
- AmA | ||
- rADar | ||
|
||
**Output**: | ||
|
||
``` | ||
true | ||
``` | ||
|
||
``` | ||
false | ||
``` | ||
|
||
``` | ||
true | ||
``` | ||
|
||
``` | ||
true | ||
``` |
12 changes: 12 additions & 0 deletions
12
challenges/2-palindromos/dart/lokoinsanus/palindromos.dart
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
main(List<String> args) { | ||
print(invert(args[0])); | ||
} | ||
|
||
invert(String word) { | ||
List<String> inverse = []; | ||
word = word.toUpperCase(); | ||
for (var i = word.length - 1; i >= 0; i--) { | ||
inverse.add(word[i]); | ||
} | ||
return inverse.join('') == word ? true : false; | ||
} |