Skip to content
the poor coder

Home / Author

Poor Man

2,994 posts
2022

10 Most Common JavaScript FAQs in One Place

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…

javascriptfaq9 min read
2022

Python coding challenge - Sorting socks solution analysis

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…

3 min read
2022

Leetcode - Longest Palindromic Substring Solution

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

2 min read
2022

Leetcode - Search in Rotated Sorted Array Solution

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…

1 min read
2022

Leetcode - Jump Game II Solution

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…

1 min read
2022

Leetcode - Jump Game Solution

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…

1 min read
2022

Leetcode - Merge Intervals Solution

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…

1 min read
2022

Leetcode - Maximum Product Subarray Solution

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…

1 min read
2022

Leetcode - Subarray Sum Equals K Solution

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…

1 min read
2021

Leetcode - Camelcase Matching Solution

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…

2021

Leetcode - Car Pooling Solution

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…

leetcodegreedy1 min read
2021

Leetcode - Find the Highest Altitude Solution

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…

leetcodearray1 min read
2021

Leetcode - Average Waiting Time Solution

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…

leetcodearray4 min read
ESC