icon
Personal Website

Weekly Coding • 2024-11-11

This text was automatically translated to English language by LLM tool.

Hello everyone. Here is what I worked on last week:

  1. Digital Drawing: 12 hours
    1. Coloring a drawing. I used a black and white sketch that I didn’t draw myself; I just decided to paint it… I need to apply colors, shadows, and other details. This took much longer than I initially expected. Doing it without AI; still not finished yet 🥵
  2. Solving problems on LeetCode: 3 hours. Solved three problems:
    1. 49. Group Anagrams
      1. This was easy: using a HashMap 😴 The solution fits into about 10 lines of TypeScript code.
    2. 51. N-Queens
      1. Chess… I managed to write a solution here, but couldn’t optimize it. So, I decided to use pre-calculation: on my home computer, I calculated all nine possible solutions and then submitted the code with the pre-calculated results to the online test.
    3. 52. N-Queens II
      1. This problem is exactly like the previous one; I wouldn’t even count it as a separate task. In the previous problem, you had to output the chess solutions, and in this one, you have to output the number of solutions—it’s the same thing, just adding return results.length;

…and here I am again encountering problems that were on my school informatics lessons: I remember those chess ones 😐 and I remember how hopelessly I tried to solve them in Turbo Pascal during class within 45 minutes. And this past weekend, it took me 2 hours just to solve this one problem. And yeah, “pre-calculation” wouldn’t have worked in school: computers back then were tens of times slower than my home computer today, so I would have had to wait another hour for the chess pre-calculations to finish. That means there was no way I could have finished it in 45 minutes 🌧️