From 5d54ec9cfd619e8c31182bedacc5a7ddeeb95762 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Wed, 4 Oct 2023 09:08:16 -0300 Subject: [PATCH] Finalizando o desafio --- .../2-palindromos/kotlin/herco/README.md | 18 ++++++++++++++++++ .../2-palindromos/kotlin/herco/palindrome.kt | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 challenges/2-palindromos/kotlin/herco/README.md create mode 100644 challenges/2-palindromos/kotlin/herco/palindrome.kt diff --git a/challenges/2-palindromos/kotlin/herco/README.md b/challenges/2-palindromos/kotlin/herco/README.md new file mode 100644 index 00000000..5f73191e --- /dev/null +++ b/challenges/2-palindromos/kotlin/herco/README.md @@ -0,0 +1,18 @@ +# Submissão de Exercicio + +**Exercicio:** 2 - palindromos + +**Nickname:** Herco + +**Nível Técnico:** - Junior + +**Dificuldade de Resolução:** - Baixa + +**Como rodar o desafio**: +Para executar o aplicativo é necessário já ter o ambiente Java configurado em sua máquina e o compilador do Kotlin que pode ser instalado seguindo a [documentação oficial](https://kotlinlang.org/docs/command-line.html). Caso utilize Windows basta seguir [este](https://downlinko.com/download-install-kotlin-windows.html) passo a passo. + +Use o comando abaixo: +```bash +kotlinc palindrome.kt -include-runtime -d palindrome.jar +java -jar palindrome.jar +``` \ No newline at end of file diff --git a/challenges/2-palindromos/kotlin/herco/palindrome.kt b/challenges/2-palindromos/kotlin/herco/palindrome.kt new file mode 100644 index 00000000..be757b1c --- /dev/null +++ b/challenges/2-palindromos/kotlin/herco/palindrome.kt @@ -0,0 +1,3 @@ +fun main() = println(isPalindrome(readln().trim())) + +private fun isPalindrome(valor: String) = valor.equals(valor.reversed(), ignoreCase = true) \ No newline at end of file