my image

Dmitrii Volyx

Performance Engineer

FinTech on Kotlin and proper bicycles on top of Postgres

You can listen the full episode of the podacst here: https://javaswag.github.io/episode/78/ Interviewer: Welcome to this special interview, drawing on insights from the recent Java Swag podcast with Filipp, an architect at lektone.op. Filipp, thank you for joining us. Filipp: Glad to be here. Interviewer: You’ve had a long and varied career in programming. Could you start by telling us about your journey into Java and how you began writing industrial systems? ...

July 4, 2025 · 18 min · volyx

AOC 2022. Day 8: Treetop Tree House

— Day 8: Treetop Tree House — The expedition comes across a peculiar patch of tall trees all planted carefully in a grid. The Elves explain that a previous expedition planted these trees as a reforestation effort. Now, they’re curious if this would be a good location for a tree house. First, determine whether there is enough tree cover here to keep a tree house hidden. To do this, you need to count the number of trees that are visible from outside the grid when looking directly along a row or column. ...

December 10, 2022 · 7 min · volyx

AOC 2022. Day 7: No Space Left On Device

— Day 7: No Space Left On Device — You can hear birds chirping and raindrops hitting leaves as the expedition proceeds. Occasionally, you can even hear much louder sounds in the distance; how big do the animals get out here, anyway? The device the Elves gave you has problems with more than just its communication system. You try to run a system update: $ system-update –please –pretty-please-with-sugar-on-top Error: No space left on device Perhaps you can delete some files to make space for the update? ...

December 9, 2022 · 7 min · volyx

Advent Of Code. Day 4: Camp Cleanup

Day 4: Camp Cleanup https://adventofcode.com/2022/day/4 Space needs to be cleared before the last supplies can be unloaded from the ships, and so several Elves have been assigned the job of cleaning up sections of the camp. Every section has a unique ID number, and each Elf is assigned a range of section IDs. However, as some of the Elves compare their section assignments with each other, they’ve noticed that many of the assignments overlap. To try to quickly find overlaps and reduce duplicated effort, the Elves pair up and make a big list of the section assignments for each pair (your puzzle input). ...

December 5, 2022 · 4 min · volyx

Advent Of Code. Day 3: Rucksack Reorganization

Day 3: Rucksack Reorganization Advent Of Code 2022. Day 3 One Elf has the important job of loading all of the rucksacks with supplies for the jungle journey. Unfortunately, that Elf didn’t quite follow the packing instructions, and so a few items now need to be rearranged. Each rucksack has two large compartments. All items of a given type are meant to go into exactly one of the two compartments. The Elf that did the packing failed to follow this rule for exactly one item type per rucksack. ...

December 4, 2022 · 5 min · volyx

Advent of Code. Day 1: Calorie Counting

Day 1: Calorie Counting Link Santa’s reindeer typically eat regular reindeer food, but they need a lot of magical energy to deliver presents on Christmas. For that, their favorite snack is a special type of star fruit that only grows deep in the jungle. The Elves have brought you on their annual expedition to the grove where the fruit grows. To supply enough magical energy, the expedition needs to retrieve a minimum of fifty stars by December 25th. Although the Elves assure you that the grove has plenty of fruit, you decide to grab any fruit you see along the way, just in case. ...

December 2, 2022 · 4 min · volyx

138. Copy List with Random Pointer

A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. Construct a deep copy of the list. The deep copy should consist of exactly n brand new nodes, where each new node has its value set to the value of its corresponding original node. Both the next and random pointer of the new nodes should point to new nodes in the copied list such that the pointers in the original list and copied list represent the same list state. None of the pointers in the new list should point to nodes in the original list. ...

January 31, 2022 · 2 min · volyx

408. Valid Word Abbreviation

A string can be abbreviated by replacing any number of non-adjacent, non-empty substrings with their lengths. The lengths should not have leading zeros. For example, a string such as “substitution” could be abbreviated as (but not limited to): “s10n” (“s ubstitutio n”) “sub4u4” (“sub stit u tion”) “12” (“substitution”) “su3i1u2on” (“su bst i t u ti on”) “substitution” (no substrings replaced) The following are not valid abbreviations: ...

January 31, 2022 · 2 min · volyx

1291. Sequential Digits

An integer has sequential digits if and only if each digit in the number is one more than the previous digit. Return a sorted list of all the integers in the range [low, high] inclusive that have sequential digits. Example 1: Input: low = 100, high = 300 Output: [123,234] Example 2: Input: low = 1000, high = 13000 Output: [1234,2345,3456,4567,5678,6789,12345] Constraints: 10 <= low <= high <= 10^9 Solution Sliding Window class Solution { public List<Integer> sequentialDigits(int lo, int hi) { int lenLo = getLen(lo); int lenHi = getLen(hi); int i = lenLo; List<Integer> res = new ArrayList<>(); while (i <= lenHi) { res.addAll(buildSeqNums(i, lo, hi)); i++; } return res; } int getLen(int n) { return Integer.toString(n).length(); } String SAMPLE = "123456789"; List<Integer> buildSeqNums(int n, int lo, int hi) { if (n == 0) return Collections.emptyList(); int start = 0; List<Integer> res = new ArrayList<>(); while (start + n < SAMPLE.length() + 1) { int val = Integer.parseInt(SAMPLE.substring(start, start + n)); if (val >= lo && val <= hi) { res.add(val); } start++; } return res; } }

January 30, 2022 · 1 min · volyx

339. Nested List Weight Sum

You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. The depth of an integer is the number of lists that it is inside of. For example, the nested list [1,[2,2],[[3],2],1] has each integer’s value set to its depth. Return the sum of each integer in nestedList multiplied by its depth. ...

January 30, 2022 · 2 min · volyx