Software Engineering
Find Common Characters
Given an array of strings, find characters that appear in all strings including duplicates. This solution uses character counting with O(N) time complexity and O(1) space.
February 5, 2026
Function Exclusive Time Calculation
Solve function call tracking problems using stack simulation. This approach models execution order as a call stack structure and handles time calculation edge cases in function timing analysis.
February 5, 2026
Gas Station Problem
Given gas stations with fuel amounts and costs to reach next stations, find the starting index that allows completing the full circuit. The solution uses a greedy approach with O(n) time complexity.
February 5, 2026
Implementing pow(x, n)
A simple implementation of the power function using binary exponentiation. The algorithm reduces time complexity from O(n) to O(log n) by halving the exponent at each step and handling negative powers separately.
February 5, 2026
Insufficient Nodes in Root to Leaf Paths
Given a binary tree and a limit, remove all leaf nodes where the sum of values from root to that leaf is strictly less than the given limit. This pruning operation affects the entire path structure of the tree.
February 5, 2026
LRU Cache Implementation
Two implementations of LRU cache using hash table and doubly linked list. The first uses custom nodes with pointer manipulation for optimal performance. The second leverages STL containers for cleaner code.
February 5, 2026
Max Consecutive Ones III
Find the length of the longest contiguous subarray containing only 1s when you can flip up to K zeros to ones. Uses a sliding window approach with O(n) time complexity.
February 5, 2026
Palindrome Partitioning with Backtracking
Solve the palindrome partitioning problem using depth-first search and backtracking. The approach systematically finds all possible ways to split a string into palindromic substrings by recursively exploring each potential partition point.
February 5, 2026
Remove Duplicates from Sorted Arrays
Three approaches to remove duplicates from sorted arrays in place. Start with complex case analysis, then simplify to step counting and threshold filtering methods.
February 5, 2026
Remove Sub-Folders from Filesystem
Given an array of directory strings, return only parent directories by removing sub-folders. Sorting transforms the hierarchical problem into a linear one, avoiding complex tree structures while achieving O(n log n) time complexity.
February 5, 2026