Skip to content

Only Code

Eat Code Sleep – repeat

  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Close menu
  • Github
  • Home
  • Arrays
  • Linked Lists
  • Trees
  • Stacks
  • Queues
  • Heaps
  • Graphs
  • Algorithms
    • Sorting
    • Dynamic Programming
    • Divide and Conquer
    • Backtracking & Recursion
    • Greedy approach
    • Breadth First Search (BFS)
    • Depth First Search (DFS)

Only Code

Eat Code Sleep – repeat

Search Toggle menu

Tag: competitive Programming

Subset Sum Problem | Meet in the Middle

Meet in the Middle is used to optimize brute-force solutions for problems where the input size is too large for direct approaches.

Arrays, Competitive Programming

Partition Equal Subset Sum – LeetCode Solution [Medium]

Given an integer array determine if you can partition the array into two subsets such that the sum of the elements in both subsets is equal.

Arrays, Competitive Programming

Two Sum Problem | Two-Pointer Technique

This method involves sorting the array and then using two pointers to identify a pair of numbers whose sum equals the target.

Arrays, Competitive Programming

Counting Inversions using Fenwick Tree

Fenwick Trees can efficiently track and count inversions in real-time and even for a continuous stream of data.

Arrays, Competitive Programming

Max of All Subarrays of Size k Using Max Heap in C++

This problem, also referred to as the “sliding window maximum” problem, can be efficiently solved using heaps. We’ve already discussed an O(n) solution.

Arrays, Competitive Programming, Heaps, Interview Questions

Understanding Linearity of Expectation

Linearity of expectation is a powerful concept in probability theory that simplifies the calculation of expected values in probabilistic experiments.

Competitive Programming, Mathematics

Is Subsequence – LeetCode Solution [Easy]

Given two strings s and t, return true if s is a subsequence of t, or false otherwise.

Competitive Programming

Generate Pythagorean Triples

Given an integer limit, generate all Pythagorean Triples with values smaller than limit.

Interview Questions, Mathematics

Minimum Moves to Equal Array Elements – LeetCode Solution [Medium]

When we increment n – 1 elements, the relative difference between the highest number and all other numbers effectively decreases by 1.

Arrays, Competitive Programming, Mathematics

Modular Multiplicative Inverse and Modular Combinatorics (nCr % prime) in C++

In mathematics, particularly in the area of arithmetic, a modular multiplicative inverse of an integer a is an integer x such that the product ax is congruent to 1 with respect to the modulus m.

Competitive Programming, Mathematics

Posts pagination

1 2 >
  • Algorithms
  • Arrays
  • Backtracking & Recursion
  • Breadth First Search (BFS)
  • C/C++
  • Competitive Programming
  • Computer Science
  • Data Science
  • Databases
  • Depth First Search (DFS)
  • Divide and Conquer
  • Dynamic Programming
  • Graphs
  • Greedy approach
  • Hashmaps
  • Heaps
  • Interview Questions
  • Java
  • Linked Lists
  • Machine Coding Questions
  • Machine Learning
  • Mathematics
  • Networking
  • Programming Projects
  • Python
  • Queues
  • Sorting
  • Special Data Structures
  • Stacks
  • Trees
  • Web Development
© 2025 Only Code | Aureolls