# easy-problems

## First Bad Version | Leetcode | Solution

Hi, In this post we will be discussing the first bad version problem present on LeetCode Video Solution Problem Statement You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous First Bad Version | Leetcode | Solution

## Count Good Nodes In Binary Tree | LeetCode

Problem Source Given a binary tree containing N nodes, where each node contains some value. Count the number of good nodes in the tree. Count Good Nodes In Binary Tree Video Explanation Count Good Nodes In Binary Tree Solution For example, in the below tree The nodes marked in blue are good nodes, because they Count Good Nodes In Binary Tree | LeetCode

## Deepest Leaves Sum | LeetCode

Problem Source Given a binary tree with N nodes. Each node in the binary tree contains some value associated with it. Find the sum of values present in the leaf nodes present at highest depth. For example for the tree given below, the sum is 7 + 8 = 15. Because and 7 and 8 Deepest Leaves Sum | LeetCode

## How to check if two binary trees are identical ?

Given two binary trees, write a program to check if the two binary trees are identical or not ? Solution We can solve the above problem recursively. If the root node of the tree is equal then we check for the equality of left subtree and right subtree.Similarly, we check for the equality of the How to check if two binary trees are identical ?

## Find Missing Number In An Array Without Using Extra Space

Given an array of size n-1 which contains all the numbers within range 1 to n with exactly one number as missing. Find that missing number without using any extra space. Test Cases Test Case 1 Input: 1 2 4Output: 3Explanation: 3 is missing in the above array. Test Case 2 Input: 1 3 4 Find Missing Number In An Array Without Using Extra Space

## Print a matrix in spiral order

Given a nxm matrix , print the matrix in spiral order. Test Case Example 1 Sample Input: Expected Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Solution To solve this problem, we will define 4 variables left: Print a matrix in spiral order

## Sort an array in one swap where two elements are swapped by mistake

Given an array of size n in which two elements were swapped by mistake. Sort this array in one swap. It is guaranteed that such a solution exists. This array doesn’t contain duplicates Test Cases Example Input 1 Input Array: 1 2 3 6 5 4Expected Output: 1 2 3 4 5 6In the above Sort an array in one swap where two elements are swapped by mistake

## Find Maximum Product Of Two Integers In An Array

Given an array with n elements, find the maximum product of two integers in this array. Test Cases Example Test Case 1 Sample Input: 4 6 1 9 8Expected Output: 72Because out of all the possible combinations of two integers in the array, 9*8 provides the maximum value. Example Test Case 2 Sample Input: -2, Find Maximum Product Of Two Integers In An Array

## Logger Rate Limiter | Leet Code

Logger Rate Limiter | Leet Code Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printed in the last 10 seconds. Given a message and a timestamp (in seconds granularity), return true if the message should be printed in Logger Rate Limiter | Leet Code

## Bulls & Cows | Leet Code

Bulls And Cows | Leet Code You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret Bulls & Cows | Leet Code

[gravityforms id="5" description="false" titla="false" ajax="true"]