Skip to content

Instantly share code, notes, and snippets.

View Sedose's full-sized avatar
:shipit:

Sedose Sedose

:shipit:
  • Ukraine
View GitHub Profile
fun main() {
input.let(::calculatePassword)
.let(::println)
}
fun calculatePassword(input: List<String>): Int =
input.map(::parseMoveDelta)
.scan(50) { position, delta ->
normalize(position + delta)
}
@Sedose
Sedose / AASolution.kt
Last active November 8, 2025 06:08
https://leetcode.com/problems/increasing-order-search-tree solution that clearly separates `the logic of tree traversal order` from `the logic of building resulting linked list`
class Solution {
fun increasingBST(root: TreeNode?): TreeNode? {
val dummy = TreeNode(0)
var current = dummy
inorder(root) { node ->
node.left = null
current.right = node
current = node
}
@Sedose
Sedose / LeetCode problems solved in Kotlin.md
Last active November 2, 2025 06:33
LeetCode problems solved in Kotlin

LeetCode problems solved in Kotlin

Notes

  • This is a work in progress.
  • The content is optimized to retrieve necessary information quickly, so the content is in this single page, searchable by tags and using full-text search.

897. Increasing Order Search Tree

@Sedose
Sedose / entity-matching-lib.md
Last active August 11, 2025 07:53
Configurable Entity Matching Engine

entity-matching-lib.md

A small, composable JVM library for matching entities across two lists using a set of field names. Designed for Java/Kotlin backends, favors composition, data classes, and ADTs. No reflection required unless you opt into it.


Contents

  • Overview
  • Core API (Kotlin, Java-callable)
@Sedose
Sedose / Readme.md
Created August 8, 2025 13:02
GCP PCD KB

Google Cloud Platform Professional Cloud Developer – Knowledge Base

This document serves as a consolidated knowledge base for GCP PCD preparation and reference.
It includes concepts, best practices, and architectural details relevant to professional cloud developers.


Table of Contents

  1. Security Design in Google Cloud
@Sedose
Sedose / SpringKoltinShowcase.kt
Created August 3, 2025 06:07
TimeApiConfig is injected successfully into MyService in runtime
interface ApiSettings<T>
@Component
class TimeApiConfig(val someString: String = "SeeMeAvailableInInjectedInRuntime") : ApiSettings<String>
@Component
class OtherApiConfig : ApiSettings<Integer>
@Service
@Sedose
Sedose / ExceptionShowcase.java
Last active August 2, 2025 08:40
Java Exceptions preserve stacktrace even without throwing (even when we just return Exception from mehtod)
class Main {
public static void main(String[] args) {
Exception exception = new Main().invokeTopLevel();
exception.printStackTrace();
}
Exception invokeTopLevel() {
return invokeSecondLevel();
@Sedose
Sedose / main.go
Created July 31, 2025 06:13
This Go program demonstrates struct embedding aka automatic boilerplate free delegation. Try it out https://go.dev/play/p/0rauYusjgh8
package main
import "fmt"
type FifthLevelA struct{}
func (f FifthLevelA) ExecuteA() string {
return "executed in fifth level"
}
@Sedose
Sedose / shell.py
Last active July 28, 2025 05:13
Command Pattern via Function Mapping
import os
import sys
import subprocess
def handle_cd(args):
target_dir = os.path.expanduser(args[0] if args else "~")
try:
os.chdir(target_dir)
except OSError: