Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

# Category Leetcode Solution

## Meeting Rooms III LeetCode Solution

Problem – Meeting Rooms III LeetCode Solution You are given an integer n. There are n rooms numbered from 0 to n – 1. You are given a 2D integer array meetings where meetings[i] = [starti, endi] means that a meeting will be held during the half-closed time interval [starti, endi). All the…

## Rising Temperature LeetCode Solution

Problem – Rising Temperature LeetCode Solution SQL Schema Table: Weather Write an SQL query to find all dates’ Id with higher temperatures compared to its previous dates (yesterday). Return the result table in any order. The query result format is in the following example.…

## Maximal Square LeetCode Solution

Problem – Maximal Square LeetCode Solution Given an m x n binary matrix filled with 0‘s and 1‘s, find the largest square containing only 1‘s and return its area. Example 1: Example 2: Example 3: Input: matrix = [[“0”]] Output: 0 Constraints: m == matrix.length n == matrix[i].length 1…

## Count Complete Tree Nodes LeetCode Solution

Problem – Count Complete Tree Nodes LeetCode Solution Given the root of a complete binary tree, return the number of the nodes in the tree. According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes…

## Rectangle Area LeetCode Solution

Problem – Rectangle Area LeetCode Solution Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles. The first rectangle is defined by its bottom-left corner (ax1, ay1) and its top-right corner (ax2, ay2). The second rectangle is defined by its bottom-left corner (bx1,…

## Word Frequency LeetCode Solution

Problem – Word Frequency LeetCode Solution Write a bash script to calculate the frequency of each word in a text file words.txt. For simplicity sake, you may assume: words.txt contains only lowercase characters and space ‘ ‘ characters. Each word must consist of lowercase…

## Basic Calculator LeetCode Solution

Problem – Basic Calculator LeetCode Solution Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation. Note: You are not allowed to use any built-in function which evaluates strings as mathematical expressions, such as eval().…

## Invert Binary Tree LeetCode Solution

Problem – Invert Binary Tree LeetCode Solution Given the root of a binary tree, invert the tree, and return its root. Example 1: Example 2: Example 3: Constraints: The number of nodes in the tree is in the range [0, 100]. -100 <= Node.val…

## Summary Ranges LeetCode Solution

Problem – Summary Ranges LeetCode Solution You are given a sorted unique integer array nums. A range [a,b] is the set of all integers from a to b (inclusive). Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly one…

## Majority Element II LeetCode Solution

Problem – Majority Element II LeetCode Solution Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Example 1: Example 2: Example 3: Constraints: 1 <= nums.length <= 5 * 104 -109 <= nums[i] <= 109…