1) What is the use of === in JavaScript? The triple equals operator (===) is a comparison operator in JavaScript that returns true if the two operands are strictly equal (type and value) and false otherwise. Strict…
Web3 is the third generation of the World Wide Web, which is based on the decentralized ledger technology of blockchain. With web3, we can think about and use money in a completely new way. The first generation of the…
A function to generate a random 2 char string Different Solutions Different Runtime Solution by Carl F. Corneil - 17.4s Solution by Vishal Basumatary - 0.6s Solution by Robert Nix - 18.8s Solution by Francesco Loffredo…
Given a string s, find the length of the longest substring without repeating characters. Example 1: Example 2: Example 3: Constraints: 0 <= s.length <= 5 * 104 s consists of English letters, digits, symbols and spaces…
Given a string s, return the longest palindromic substring in s. Example 1: Example 2: Constraints: 1 <= s.length <= 1000 s consist of only digits and English letters. Solution in Python3
There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the…
Given an array of non-negative integers nums, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your goal is to reach the last…
You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you can reach the last…
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Example 1: Example 2…
Given an integer array nums, find a contiguous non-empty subarray within the array that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32-bit integer. A…
Given an array of integers nums and an integer k, return the total number of continuous subarrays whose sum equals to k. Example 1: Example 2: Constraints: 1 <= nums.length <= 2 * 104 -1000 <= nums[i] <= 1000 -107 <= k…
A query word matches a given pattern if we can insert lowercase letters to the pattern word so that it equals the query. (We may insert each character at any position, and may insert 0 characters.) Given a list of…
You are driving a vehicle that has capacity empty seats initially available for passengers. The vehicle only drives east (ie. it cannot turn around and drive west.) Given a list of trips, trip[i] = [num_passengers…
There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0. You are given an integer array gain of length n where…
A good meal is a meal that contains exactly two different food items with a sum of deliciousness equal to a power of two. You can pick any two different foods to make a good meal. Given an array of integers…
You are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half. Two strings are alike if they have the same number of vowels ('a', 'e'…
There is a restaurant with a single chef. You are given an array customers, where customers[i] = [arrivali, timei]: arrivali is the arrival time of the ith customer. The arrival times are sorted in non-decreasing order…
A decimal number is called deci-binary if each of its digits is either 0 or 1 without any leading zeros. For example, 101 and 1100 are deci-binary, while 112 and 3001 are not. Given a string n that represents a positive…