Blog

Common Go Concurrency Patterns

A comprehensive guide to the most common concurrency patterns in Go programming including request-response, single state manager, producer-consumer, and pipeline patterns. Learn how to organize and manage goroutines effectively for robust concurrent programs.

September 22, 2019

Leetcode 989. Add to Array-Form of Integer

Solution to LeetCode problem 989 that adds an integer K to an array-form number and returns the result as array-form. The approach handles cases where the input array represents small numbers by converting to integer, and for larger arrays uses digit-by-digit addition with carry propagation.

February 14, 2019

Leetcode 985. Sum of Even Numbers After Queries

Solution to LeetCode problem 985 involving efficiently calculating sum of even numbers after each query operation with O(N) time complexity and O(1) space complexity using optimized approach.

February 13, 2019

POJ 3616 Milking Time

Solution to POJ problem 3616 Milking Time using weighted interval DP approach. The algorithm sorts intervals by start time and uses dynamic programming to find maximum efficiency while considering rest periods between milking sessions.

July 29, 2018

POJ 2385 Apple Catching 0ms Solution

Detailed solution and explanation for POJ 2385 Apple Catching problem using dynamic programming with 0ms execution time. Complete C++ code implementation with optimization techniques.

July 14, 2018

POJ 2229 Sumsets

Solution to POJ problem 2229 Sumsets using dynamic programming approach. The algorithm calculates the number of ways to represent a number as sums of powers of 2 with optimized time complexity through pattern recognition and modular arithmetic.

July 12, 2018

POJ 3176 Cow Bowling

Solution to POJ 3176 Cow Bowling problem using dynamic programming approach. This classic DP problem involves finding the maximum sum path in a triangular number array by moving from top to bottom with specific movement rules.

July 11, 2018

Poj 3262 Protecting the Flowers

Solution to POJ 3262 Protecting the Flowers using greedy algorithm. The problem involves minimizing the total damage by optimally ordering flower protection tasks based on time and damage rates.

July 11, 2018

POJ 1017 Packets

POJ 1017 Packets

Solution to POJ 1017 Packets problem using greedy algorithm. This classic packing problem involves optimally arranging packets of different sizes into minimum number of containers with size constraints.

July 10, 2018

poj 3040 Allowance

POJ 3040 Allowance problem solution using greedy algorithm. This classic greedy problem involves optimizing coin usage to maximize weekly allowances by strategically selecting coins of different denominations.

July 10, 2018