Yahoo India Web Search

Search results

  1. Jun 28, 2024 · Given an array of integers, find all combination of four elements in the array whose sum is equal to a given value X. Example: Input: array = {10, 20, 30, 40, 1, 2}, X = 91. Output: 20 30 40 1. Explanation: Sum of 20 + 30 + 40 + 1 = 91. Input: array = {1, 2, 3, 4, 5, 9, 7, 8}, X = 16. Output: 1 3 5 7.

    • 3 min
  2. Jun 22, 2024 · The Number of Ways to Make the Sum 🔒. Description. You have an infinite number of coins with values 1, 2, and 6, and only 2 coins with value 4. Given an integer n, return the number of ways to make the sum of n with the coins you have. Since the answer may be very large, return it modulo 10 9 + 7.

  3. Jun 19, 2024 · In this article, I will guide you through two popular LeetCode challenges: “Add Two Numbers” and “Two Sum.” We’ll explore how to approach these problems, understand the underlying ...

  4. Jul 1, 2024 · Learn how to solve LeetCode's Combination Sum problem using optimized backtracking techniques. This guide covers algorithm explanations, step-by-step guide.

  5. Jun 27, 2024 · Given two arrays A[] and B[] of size N and M respectively, the task is to find the sum of Bitwise AND of all possible unordered pairs (A[i], B[j]) from the two arrays. Examples: Input: A[] = {1, 2} , B[] = {3, 4} Output: 3 Explanation: Bitwise AND of all possible pairs are 1 & 3 = 1 1 & 4 = 0 2 & 3 = 2 2 & 4 = 0 Therefore, the sum o

    • 8 min
  6. Jun 11, 2024 · Can you solve this real interview question? Continuous Subarray Sum - Given an integer array nums and an integer k, return true if nums has a good subarray or false otherwise. A good subarray is a subarray where: * its length is at least two, and * the sum of the elements of the subarray is a multiple of k.

  7. Jun 25, 2024 · Binary Search Tree to Greater Sum Tree - Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.