Learn Kotlin with The Kotlin Team: Advent of Code 2020 #2

preview_player
Показать описание
Let’s continue to learn Kotlin with the Kotlin team by solving the Advent of Code 2020 tasks in Kotlin!*

Advent of Code Day 2: Password philosophy
We are looking at string utility functions, regular expressions, operations on collections, and how the "let" function helps to transform the expression nicely to the form you need.

0:00 Intro
0:35 Day 2 task description
1:10 Policy in Part I
1:45 Policy in Part II
2:29 Reading input
4:12 Parsing input: using utility functions on Strings
6:47 Parsing input: using regular expressions
8:46 Password validation: Part I
9:36 Password validation: Part II
10:31 Conclusion

Please let us know if you find this format useful and would like us to provide solutions for more difficult tasks!

* Used with the permission of Advent of Code (Eric Wastl)

#Kotlin #Idiomatic #Tutorial #AdventOfCode #AdventOfCode2020 #AdventOfСodeInKotlin #Day2
Рекомендации по теме
Комментарии
Автор

This is such a good example on how beautiful Kotlin is, great Job!

bastig.
Автор

Awesome series to learn idiomatic Kotlin... Can't wait for the next episode!

ramkumarkb
Автор

Love it!
For the next episodes it might also be a good idea to show unit tests for some smaller parts in the solution.

TimSchraepen
Автор

Wow several concepts explained elegantly. ❤️ Kotlin.

vengateshm
Автор

This would be a great opportunity to provide an IntelliJ integrated course that contains all the advent of code questions. The way you have one for rustlings. With the question posed, test cases and everything so that a new user can just power through the questions easily with the IDE helping them. Please do consider it, and for all the advent of code events from here on out.
It's an absolutely perfect way to get people to try Kotlin, and let them have a great and memorable experience out of it!

GakisStylianos
Автор

This is so much better compared to my own solutions. Lots to learn here, looking forward to new episodes!

sid.h
Автор

Деструктуризация сразу по регексу - очень мощная вещь!

theLoneCodesman
Автор

I'm enjoying this series very much. Can you show that the solutions work for the puzzle input as well? The examples on the page are simplified input, and some of the later puzzles have input data which are designed to fail with naïve solutions

MarkMusante
Автор

wow thanks amazing video and lovely languge such dynamic and elegant !!

fabricioaraujo
Автор

Still waiting for the next episode, a tough wait!

Dohman
Автор

Доброго времени суток! Любой материал, которым Вы делитесь, очень полезный! Осмелюсь предположить, что у многих новичков имеется ЖУТКОЕ затруднение с настройками файлов для gradle.

andrey
Автор

wow jet brains I love your tutorial but please I need help I will love to learn programming in kolin as a beginner so I could one day use it to develop all kinds of software that kotlin can do my school does just introduction to lanuages

mbohblesspn
Автор

range = line.substringBefore(" ").let {
val (start, end) = it.split("-")
start.toInt()..end.toInt()
}
can be in a more concise "functional" style:
range = line.substringBefore(" ").split("-").let { (start, end) -> start.toInt()..end.toInt() }

acc
join shbcf.ru