Skip to content

Svetliy

  • Home
  • Blog
  • About Me
  • Three Sessions: Taking My Five-Year-Old Kiteboarding

    Three Sessions: Taking My Five-Year-Old Kiteboarding

    August 28, 2026

    Body drag, ride, jump. How I took Aiden from the beach to a tandem kite jump in three sessions — what each one was for, and what I’d tell another parent.

    Read more →


  • Coding algorithm helper

    November 14, 2021

    Tree Traversals. Depth-first: Inorder, pre-order, post-order. Bread-first.

    Read more →


  • Surrounding regions using flash flood algorithm

    November 3, 2021

    Set all of the O to – across the board For each side find adjacent – and change them to Os using flash flood algorithm Change all of the remaining – to X The complexity of the above solution is O(m*n)

    Read more →


  • Dynamic Programming

    August 16, 2021

    A list of problems that will let you learn dynamic programming Maximum Subarray Can be solved with Kadane algorithm Maximum Product Subarray Instead of using one variable to store the max we can use two variables to store max and min and flip them whenever…

    Read more →


  • Find Peak Element with JS

    July 13, 2021

    A peak element is an element that is strictly greater than its neighbors. Given an integer array nums, find a peak element, and return its index. If the array contains multiple peaks, return the index to any of the peaks. You may imagine that nums[-1] = nums[n] = -∞.…

    Read more →


  • Reduce Array Size to The Half with JS solved using dictionary

    July 6, 2021

    Given an array arr.  You can choose a set of integers and remove all the occurrences of these integers in the array. Return the minimum size of the set so that at least half of the integers of the array are removed. Solution iterate over an array and store the…

    Read more →


  • Lowest Common Ancestor in a Binary Tree LeetCode problem in JS solved with comparing vector path to each node

    June 30, 2021

    Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has…

    Read more →


  • MyCalendar LeetCode problem in JS solved with double arrays

    June 10, 2021

    Problem defenition Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking. Your class will have the method, book(int start, int end). Formally, this represents a booking on the half open interval [start, end), the…

    Read more →


  • Sparse Arrays – Hackerrank medium problem in JS solved using HashMap

    April 14, 2021

    https://www.hackerrank.com/challenges/sparse-arrays/problem The idea is to iterate over input data and put it into HashMap with keys being available strings and values being the number of times this string is present in the input. Time complexity is O(n) and space complexity O(n)

    Read more →


  • Moving boxes to one spot – Leetcode coding problem (Medium)

    March 1, 2021

    Another fun problem that was pretty easy solve is moving boxes to one spot: https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/ It can be solved by iterating over an array and summing difference in distance between elements. Solution in Javascript:

    Read more →


1 2 3 … 5
Next Page

Svetliy

Building things and raising kids on Maui

  • Home
  • Blog
  • About

Written on Maui. Powered by WordPress.