Problem 1 Find the duplicate in an array of N+1 integers. Leetcode Worst Just apply mergesort Time Complexity: $ O(nlogn) $ Auxiliary Space: $ O(n) $ Better Count the occurences of 0,1,...

# August | 2022 | Leetcoding Challenge

01 July | 62. Unique Paths 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., ...

# August | 2022 | POTD GFG

01 July | Egg Dropping Puzzle You are given N identical eggs and you have access to a K-floored building from $1$ to $K$. There exists a floor f where $0 <= f <= K$ such that any egg droppe...

# Setting up MacOS

Basic Setup /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew update brew install git vim go python curl https://bootstrap.pypa.io/get-pip.py ...

# Vim Cheat Sheet

File Management :q Exit :q! / ZQ Forceful exit SSH ssh-copy-id ...

# Day 9 Recursion | Striver 180 | takeUforward

Problem 1: Subset Sums Given a list arr of N integers, print sums of all subsets in it. Note: Return all the element is increasing order. Geeks For Geeks Brute class Solution { public: ...

# Day 8 Greedy | Striver 180 | takeUforward

Problem 1: N Meetings in a room Geeks For Geeks class Solution { public: int maxMeetings(int start[], int end[], int n) { pair<int, int> a[n + 1]; for(...

# Day 5 Linked List | Striver 180 | takeUforward

Problem 1: Reverse a LinkedList Leetcode class Solution { public: ListNode* reverseList(ListNode* next) { ListNode* prev = NULL; while(next != NULL) { ...

# Day 21 Binary Search Tree II | Striver 180 | takeUforward

Problem 1: Floor in a BST You are given a BST (Binary search tree) with’ N’ number of nodes and a value ‘X’. Your task is to find the greatest value node of the BST which is smaller than or equal ...

# Day 2 Array | Striver 180 | takeUforward

Problem 1 Leetcode Brute This question has been updated on leetcode with newer constraints : -2^31 <= matrix[i][j] <= 2^31 - 1. Hence, we will have to use some extra space. class Solu...

# Day 15 Strings | Striver 180 | takeUforward

Problem 1: Reverse Words in a String You are given a string of length N. You need to reverse the string word by word. There can be multiple spaces between two words and there can be leading or tra...

# Day 11 Binary Search | Striver 180 | takeUforward

Problem 1: Nth Root Of M You are given two positive integers N and M. You have to find the Nth root of M i.e. M^(1/N). Code Studio GFG Worst Import math library and use built-in methods. ...

# Week 3 | Grind 169 | Blind 75

1. Same Tree Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and t...

# Setting up Manjaro Linux

Basic Setup sudo pacman -Syu sudo pacman -S --needed base-devel git vim noto-fonts-emoji python-pip Gnome Change the scaling factor, if using small screen with small pixel resolution. sud...

# July | 2022 | Leetcoding Challenge

01 July | 1710. Maximum Units on a Truck You are assigned to put some amount of boxes onto one truck. You are given a 2D array boxTypes, where $boxTypes[i] = [numberOfBoxesi, numberOfUnitsPerBox-i...

# July | 2022 | POTD GFG

01 July | Matrix Exponentiation Given an equation of the form $f(n) = f(n-1) + f(n-2)$ where $f(0) = 1$ , $F(1) = 1$ , the task is to find the nth term of this sequence. Practice O(n) int F...

# June | 2022 | POTD GFG

28 June | Sum of elements between k1’th and k2’th smallest elements Given an array $A[ ]$ of $N$ positive integers and two positive integers $K1$ and $K2$. Find the sum of all elements between $K_...

# June | 2022 | Leetcoding Challenge

21 June | 1642. Furthest Building You Can Reach You are given an integer array heights representing the heights of buildings, some bricks, and some ladders. You start your journey from building 0...

# Week 2 | Grind 169 | Blind 75

1. Ransom Note Given two strings ransomNote and magazine, return true if ransomNote can be constructed by using the letters from magazine and false otherwise. Each letter in magazine can only be ...

# Week 1 | Grind 169 | Blind 75

1. Two Sum Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution...