Second largest element in binary search tree

Problem Given a BST (Binary search tree), find the second largest element of it. Examples Example 1: 1 / \ 0 2 ...

Maximum Product of Three Numbers Problem

Problem Given an integer array nums, find three numbers whose product is maximum and return the maximum product. Examples Example 1: Input: nums = [1,2,3] Output: 6 Example 2: Input: nums = [1,2,3,4] Output: 24 ...

Given an array count max number of surpassers

Problem For an array of integers, a surpasser of an integer element is an element on its right hand side that is larger than it. Given an array of integers, Output the max number of surpassers. Examples Example 1: Input: nums = [10, 3, 4, 5, 2] Output: 2 Explanation: The surpassers of 3 is 4 and 5, and 10 doesn’t have any surpasser. ...

Coin Change with Fewest Number of Coins Given Canonical System and Infinite Supply

Problem Given a amount ‘A’ and n coins/denominations v1<v2<v3<………..<vn . Write a program to find out minimum numbers of coins required to make the change for the amount ‘A’. It is also given the coin system is canonical. OR Find the minimum number of coins needed to change the input value (an integer) into coins with denominations 1, 5, and 10. Examples Example 1: ...

This site uses cookies to improve your experience on our website. By using and continuing to navigate this website, you accept this. Privacy Policy