Solving WordRectangle Sample Interview Question using Kotlin

128 Просмотры
Издатель
Big thanks to Mikhail Dvorkin in https://www.youtube.com/watch?v=abkHxIMJGIw for tackling this problem originally. I thought I'd build on it a bit in this video and solve it in my own way.

Hey folks. In this video I walk through how one would solve a "word rectangle" question, an algorithm problem.

You're given two things: a rectangular grid of letters and a list of words that might be found in that grid. Words can be constructed by starting at any cell in the grid and traversing up, down, left, or right, for each letter. Determine which words in the list of words are actually present in the grid.

---

So this is my first video in a little while, and this is my first take, so it's a little rough! Future ones will be a bit more polished.

Also, I didn't realize this, but when telling OBS to only record the IntelliJ window, it failed to record the autocomplete dialog, which makes for a bit of confusing dialog as you can't see what I'm seeing. Obviously it's not ideal but I think it's "barely tolerable" (and hopefully you agree). I'll figure something out better for next time.

0:00 Intro
3:07 Creating WordRectangle
14:11 Testing it out
15:25 Checking dictionary in rectangle
20:35 Measure performance
22:10 Dynamic programming
25:00 Adding dynamic programming code
27:52 Dynamic programming performance

You can find the final code here: https://gist.github.com/nanodeath/ba471737dbeeea4d63773ab2051d140c

#Kotlin #Programming #Learning #InterviewQuestions
Категория
Язык программирования Kotlin
Комментариев нет.