Home
Gaurav's GitHub Page
Cancel

Happy Number

This question is part of NeetCode150 series. Problem Description Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting...

Set Matrix Zeroes (InterviewBit)

This question is part of NeetCode150 series. Problem Description Given an m x n integer matrix matrix, if an element is 0, set its entire row and column to 0’s. You must do it in place. leetcode...

Spiral Matrix

This question is part of NeetCode150 series. Problem Description Given an m x n matrix, return all elements of the matrix in spiral order. leetcode Solution Spiral Traversal class Solution { ...

Rotate Image

This question is part of NeetCode150 series. Problem Description You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image ...

Reverse Integer

This question is part of NeetCode150 series. Problem Description Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bi...

Sum of Two Integers (Bit Manipulation)

This question is part of NeetCode150 series. Problem Description Given two integers a and b, return the sum of the two integers without using the operators + and -. leetcode Solution NeetCode ...

Minimum Interval to Include Each Query

PROBLEM DESCRIPTION Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. leetcode SOLUTION BRUTE FORCE...

Meeting Rooms II

PROBLEM DESCRIPTION Given an array of meeting time intervals intervals where intervals[i] = [starti, endi], return the minimum number of conference rooms required. leetcode SOLUTION APPROACH 1 ...

Meeting Rooms

PROBLEM DESCRIPTION Given an array of meeting time intervals where intervals[i] = [starti, endi], determine if a person could attend all meetings. leetcode SOLUTION class Solution { public...

Non-overlapping Intervals

PROBLEM DESCRIPTION Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove to make the rest of the intervals non-overl...