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…

View Answers

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

View Answers

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…

View Answers

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,…

View Answers

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…

View Answers

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().…

View Answers

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…

View Answers