Author: Hassan Raza
-
DSA SheetSquare Root of Integer
Given an integer A. Compute and return the square root of A. If A is not a perfect square, return…
August 10, 2023
-
23 DSA PatternsGenerate Parenthesis | Intuition + Code | Recursion Tree | Backtracking | Java
Problem Statement: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Example 1: Input: n = 3…
September 24, 2024
-
PythonTwo Sum: Check for Two Numbers with Sum K
Problem Statement (Asked By Google) Given a list of integers and a target number k, determine if there exist two…
December 29, 2024
-
DSA SheetProduct of Array Except Self
Problem Statement (Asked By Uber) Given a list of integers, return a new list such that each element at index…
December 30, 2024
-
DSA SheetSerialize and Deserialize a Binary Tree
Given the root of a binary tree, create two functions: serialize(root) – Converts the binary tree into a string representation….
January 1, 2025
-
DSA SheetFind the Smallest Missing Positive Integer
Problem Statement (Asked By Stripe) You are given an array of integers. Your task is to find the smallest missing…
January 2, 2025
-
DSA SheetConstruct and Deconstruct a Pair
Problem Statement (Asked By Jane Street) The function cons(a, b) creates a pair of two elements. Implement two functions: For…
January 3, 2025
-
DSA SheetImplement an XOR Linked List
An XOR-linked list is a memory-efficient version of a doubly linked list. Instead of each node storing separate next and…
January 4, 2025
-
DSA SheetCount Decoding Ways for Encoded Messages
Problem Statement (Asked By Facebook) Given the mapping a = 1, b = 2, …, z = 26, and an…
January 5, 2025
-
DSA SheetCount Unival Subtrees in a Binary Tree
A unival tree (short for "universal value tree") is a tree in which all nodes have the same value. Given…
January 6, 2025
-
DSA SheetLargest Sum of Non-Adjacent Numbers
Problem Statement (Asked By Airbnb) Given a list of integers, write a function to compute the largest sum of numbers…
January 7, 2025
-
DSA SheetJob Scheduler Implementation
Design a job scheduler that accepts a function f and an integer n. The scheduler should execute the function f…
January 9, 2025