Examples Example 1: Input Format: LL: 1 2 3 4 5 Result: True Explanation: The last node with the value

Continue reading# Tag: Strivers A2ZDSA Course

## Dynamic Programming: House Robber (DP 6)

Problem Statement: Dynamic Programming: House Robber (DP 6) Problem Statement Link: House Robber A thief needs to rob money in a

Continue reading## Dynamic Programming: Frog Jump with k Distances (DP 4)

In this article, we will learn about “Dynamic Programming: Frog Jump with k Distances (DP 4)” Problem Statement: Frog Jump

Continue reading## Dynamic Programming : Frog Jump (DP 3)

Problem Statement: Given a number of stairs and a frog, the frog wants to climb from the 0th stair to

Continue reading## Factorial of a Number : Iterative and Recursive

Problem Statement: Given a number X, print its factorial. To obtain the factorial of a number, it has to be

Continue reading## Check if a number is prime or not

Problem Statement: Given a number, check whether it is prime or not. A prime number is a natural number that

Continue reading## Maximum Product Subarray in an Array

Problem Statement: Given an array that contains both negative and positive integers, find the maximum product subarray. Examples Example 1:

Continue reading## Sum of first N Natural Numbers

Problem statement: Given a number ‘N’, find out the sum of the first N natural numbers. Examples: Example 1: Input:

Continue reading## Longest Consecutive Sequence in an Array

Problem Statement: You are given an array of ‘N’ integers. You need to find the length of the longest sequence

Continue reading## Merge two Sorted Arrays Without Extra Space

Problem statement: Given two sorted arrays arr1[] and arr2[] of sizes n and m in non-decreasing order. Merge them in

Continue reading