Given a weighted directed graph consisting of N nodes and M edges, the task is to find the first K shortest distances between two nodes A and B. (Assuming there are k Read more →
Greedy
13 postsGiven an array containing weights of gifts, and an integer representing maximum weight a box can contain. Each box carries at most 2 gifts at the same time, provided the sum of Read more →
In a country some special kinds of coins are available. The coin’s value is decided by a rule, that the values of the coins are first N positive odd numbers. As an Read more →