## Minimize Cash Flow among a given set of friends who have borrowed money from each other

Given a number of friends who have to give or take some amount of money from one another. Design an algorithm by which the total… Read More »

- Minimize the maximum difference between adjacent elements in an array
- Number of pairs in an array with the sum greater than 0
- Minimum salary hike for each employee such that no employee feels unfair
- Extended Knapsack Problem
- Huffman Coding using Priority Queue
- Maximum profit by buying and selling a share at most K times | Greedy Approach
- Find lexicographically smallest string in at most one swaps
- Why Prim’s and Kruskal's MST algorithm fails for Directed Graph?
- Shortest path in a directed graph by Dijkstra’s algorithm
- Find the Mth element of the Array after K left rotations
- Sum of all subarrays of size K
- Count subarrays having sum of elements at even and odd positions equal
- Number of containers that can be filled in the given time
- Maximum size of square such that all submatrices of that size have sum less than K
- Longest increasing sub-sequence formed by concatenating array to itself N times
- Count the elements having frequency equals to its value
- Maximum Possible Rating of a Coding Contest
- Minimum cost to make an Array a permutation of first N natural numbers
- Count number of triangles possible for the given sides range
- Find the maximum sum (a+b) for a given input integer N satisfying the given condition
- Queries to check if any non-repeating element exists within range [L, R] of an Array
- Count of N digit Numbers whose sum of every K consecutive digits is equal
- Proof that traveling salesman problem is NP Hard
- Lexicographical smallest number after at most K consecutive swaps
- Find the largest number smaller than integer N with maximum number of set bits
- Length of the Smallest Subarray that must be removed in order to Maximise the GCD
- Find subarray of Length K with Maximum Peak
- C++ Program for the Fractional Knapsack Problem
- Maximum sum subarray of size range [L, R]
- Minimum number of colors required to color a Circular Array

Given a number of friends who have to give or take some amount of money from one another. Design an algorithm by which the total… Read More »

Given an array of jobs where every job has a deadline and associated profit if the job is finished before the deadline. It is also… Read More »

Given arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for… Read More »

MakeMyTrip recently visited our campus.Below is my interview experience: Round 1: (Online MCQs) Section A- There were 20 Aptitude and Logical Reasoning questions which has… Read More »

There are given n ropes of different lengths, we need to connect these ropes into one rope. The cost to connect two ropes is equal… Read More »

Given a string and a positive integer d. Some characters may be repeated in the given string. Rearrange characters of the given string such that… Read More »

We introduced graph coloring and applications in previous post. As discussed in the previous post, graph coloring is widely used. Unfortunately, there is no efficient… Read More »

We recommend reading the following two posts as a prerequisite of this post. 1. Greedy Algorithms | Set 7 (Dijkstra’s shortest path algorithm) 2. Graph and… Read More »

Given a graph and a source vertex in the graph, find shortest paths from source to all vertices in the given graph. Dijkstra’s algorithm is… Read More »

We recommend to read following two posts as a prerequisite of this post. 1. Greedy Algorithms | Set 5 (Prim’s Minimum Spanning Tree (MST)) 2.… Read More »

We have discussed Kruskal’s algorithm for Minimum Spanning Tree. Like Kruskal’s algorithm, Prim’s algorithm is also a Greedy algorithm. It starts with an empty spanning tree.… Read More »

We recommend to read following post as a prerequisite for this. Greedy Algorithms | Set 3 (Huffman Coding) Time complexity of the algorithm discussed in… Read More »

What is Minimum Spanning Tree? Given a connected and undirected graph, a spanning tree of that graph is a subgraph that is a tree and… Read More »

You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. A pair (c, d) can… Read More »