Difficulty: Medium

Maximize Sum of Subsequence with Condition

Given an array of integers, maximize sub of subsequence such that the sum of any two elements in the subsequence is greater than or equal to any other element.

Read

Count the Number of Set Bits for Every Number from 0 to n

Given a number n, count the number of 1's in the binary representation of each number from 0 to n.

Read

Print Matrix in Spiral Order

Given a matrix, print all elements in spiral order.

Read

Find Combinations of a List Whose Sum is Equal to a Target

Given a list of distinct integers, find all the possible combinations which sums up to a target.

Read

Generate Spiral Matrix

Given a positive integer n, generate a square matrix filled with elements from 1 to n^2 in spiral order.

Read

Minimum Remove to Make Valid Parentheses

Given a string, remove minimum number of parentheses to make it balanced.

Read

Second Largest Node in Binary Search Tree

Given the root to a binary search tree, find the second largest node in the tree.

Read

Top k Frequent Words

How to use a Custom Comparator in C++ Priority Queue and Solving Top k Frequent Words

Read