Home
Gaurav's GitHub Page
Cancel

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 ...

Max Product Subarray

Problem Description Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32-bit integer....

Max Sum Without Adjacent Elements

Problem Description You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of the...

Friends Pairing Problem

Problem Description Given N friends, each one can remain single or can be paired up with some other friend. Each friend can be paired only once. Find out the total number of ways in which friends ...