Home
Gaurav's GitHub Page
Cancel

Maximum sum such that no two elements are adjacent

Problem Description Given an array arr[] of positive numbers, The task is to find the maximum sum of a subsequence such that no 2 numbers in the sequence should be adjacent in the array. geeksfor...

Perfect Squares

Problem Description Given an integer n, return the least number of perfect square numbers that sum to n. A perfect square is an integer that is the square of an integer; in other words, it is the...

Unique Paths II

Problem Description You are given an m x n integer array grid. There is a robot initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e...

Paint House

Problem Description There is a row of n houses, where each house can be painted one of three colors: red, blue, or green. The cost of painting each house with a certain color is different. You hav...

Unique Paths

Problem Description There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - ...

Ways to Decode

Problem Description A message containing letters from A-Z can be encoded into numbers using the following mapping: 'A' -> "1" 'B' -> "2" ... 'Z' -> "26" To decode an encoded message, a...

Maximum Sum Value - A[i]*B + A[j]*C + A[k]*D

Problem Description You are given an array A of N integers and three integers B, C, and D. You have to find the maximum value of A[i]*B + A[j]*C + A[k]*D, where 1 <= i <= j <= k <= N. ...

Search in Rotated Sorted Array

Problem Description There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (...

Koko Eating Bananas

This question is part of NeetCode150 series. Problem Description Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come bac...

Valid Sudoku

This question is part of NeetCode150 series. Problem Description Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each ...