Skip to content

Commit 2331b03

Browse files
committed
Resolución Reto #49 y enunciado Reto #50
1 parent d1ff781 commit 2331b03

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ Tienes toda la información extendida sobre los retos de programación semanales
8282
* **#47** - 21/11/22 - [`VOCAL MÁS COMÚN`](https://github.com/mouredev/Weekly-Challenge-2022-Kotlin/blob/main/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge47.kt)
8383
* **#48** - 28/11/22 - [`EL CALENDARIO DE ADEVIENTO 2022`](https://github.com/mouredev/Weekly-Challenge-2022-Kotlin/blob/main/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge48.kt)
8484
* **#49** - 05/12/22 - [`EL DETECTOR DE HANDLES`](https://github.com/mouredev/Weekly-Challenge-2022-Kotlin/blob/main/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge49.kt)
85-
* **#50** - 12/12/22 - `Publicación nuevo reto...`
85+
* **#50** - 12/12/22 - [`LA ENCRIPTACIÓN DE KARACA`](https://github.com/mouredev/Weekly-Challenge-2022-Kotlin/blob/main/app/src/main/java/com/mouredev/weeklychallenge2022/Challenge50.kt)
86+
* **#51** - 19/12/22 - `Publicación nuevo reto...`
8687

8788
<a href="https://youtu.be/ydH_B5KuqGs"><img src="http://i3.ytimg.com/vi/ydH_B5KuqGs/maxresdefault.jpg" style="height: 50%; width:50%;"/></a>
8889

app/src/main/java/com/mouredev/weeklychallenge2022/Challenge49.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,17 @@ package com.mouredev.weeklychallenge2022
2121
*
2222
*/
2323

24+
fun main() {
25+
println(handlesDetector("En esta actividad de @mouredev, resolvemos #retos de #programacion desde https://retosdeprogramacion.com/semanales2022, que @braismoure aloja en www.github.com"))
26+
}
2427

28+
private fun handlesDetector(text: String): Map<String, List<String>> {
2529

30+
val handles = mutableMapOf<String, List<String>>()
31+
32+
handles["user"] = "@(\\w{2,15})".toRegex().findAll(text).toList().map { it.value }
33+
handles["hashtag"] = "#[^ !@$^#&,.?():%<>{}\\[\\]|\"]+".toRegex().findAll(text).toList().map { it.value }
34+
handles["url"] = "((https?://(www\\.)?)|www\\.)[\\w#+\\=]{2,256}\\.[a-zA-Z]{2,7}[\\w\\/?=&.+-]*".toRegex().findAll(text).toList().map { it.value }
35+
36+
return handles
37+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.mouredev.weeklychallenge2022
2+
3+
/*
4+
* Reto #50
5+
* LA ENCRIPTACIÓN DE KARACA
6+
* Fecha publicación enunciado: 12/11/22
7+
* Fecha publicación resolución: 19/12/22
8+
* Dificultad: FÁCIL
9+
*
10+
* Enunciado: Crea una función que sea capaz de encriptar y desencriptar texto utilizando el
11+
* algoritmo de encriptación de Karaca (debes buscar información sobre él).
12+
*
13+
* Información adicional:
14+
* - Usa el canal de nuestro Discord (https://mouredev.com/discord) "🔁reto-semanal"
15+
* para preguntas, dudas o prestar ayuda a la comunidad.
16+
* - Tienes toda la información sobre los retos semanales en
17+
* https://retosdeprogramacion.com/semanales2022.
18+
*
19+
*/

0 commit comments

Comments
 (0)