1,724 articles across 10 categories

Stories, Tutorials & Life Tips

Deep dives on coding, health, recipes, travel and everything in between.

📍 Explore Reading Paths

Follow curated journeys from beginner to expert

Count Primes - Hash Table - Easy - LeetCode
Featured

Count Primes - Hash Table - Easy - LeetCode

Count the number of prime numbers less than a non-negative number, n.   Example 1: Input: n = 10Output: 4Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.Example 2: Input:

1 min read27 Sept 2020
Read article
Happy Number - Hash Table - Easy - LeetCode

Happy Number - Hash Table - Easy - LeetCode

Write an algorithm to determine if a number n is "happy". A happy number is a number defined by the following process: S

1 min27 Sept
Sum of All Odd Length Subarrays - Array - Easy - LeetCode

Sum of All Odd Length Subarrays - Array - Easy - LeetCode

Given an array of positive integers arr, calculate the sum of all possible odd-length subarrays. A subarray is a contigu

2 min27 Sept
Special Positions in a Binary Matrix - Array - Easy - LeetCode

Special Positions in a Binary Matrix - Array - Easy - LeetCode

Given a rows x cols matrix mat, where mat[i][j] is either 0 or 1, return the number of special positions in mat. A posit

1 min27 Sept
Matrix Diagonal Sum - Array - Easy - LeetCode

Matrix Diagonal Sum - Array - Easy - LeetCode

Given a square matrix mat, return the sum of the matrix diagonals. Only include the sum of all the elements on the prima

1 min27 Sept
Detect Pattern of Length M Repeated K or More Times - Array - Easy - LeetCode

Detect Pattern of Length M Repeated K or More Times - Array - Easy - LeetCode

Given an array of positive integers arr,  find a pattern of length m that is repeated k or more times. A pattern is

2 min27 Sept
Most Visited Sector in a Circular Track - Array - Easy - LeetCode

Most Visited Sector in a Circular Track - Array - Easy - LeetCode

Given an integer n and an integer array rounds. We have a circular track which consists of n sectors labeled from 1 to n

1 min27 Sept
Three Consecutive Odds - Array - Easy - LeetCode

Three Consecutive Odds - Array - Easy - LeetCode

Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false

1 min27 Sept
Kth Missing Positive Number - Array - Easy - LeetCode

Kth Missing Positive Number - Array - Easy - LeetCode

Given an array arr of positive integers sorted in a strictly increasing order, and an integer k. Find the kth positive i

1 min27 Sept
Count Good Triplets - Array - Easy - LeetCode

Count Good Triplets - Array - Easy - LeetCode

Given an array of integers arr, and three integers a, b and c. You need to find the number of good triplets. A triplet (

1 min27 Sept
Number of Good Pairs - Array - Easy - LeetCode

Number of Good Pairs - Array - Easy - LeetCode

Given an array of integers nums. A pair (i,j) is called good if nums[i] == nums[j] and i < j. Return the number of go

1 min27 Sept
पूर्व केंद्रीय मंत्री जसवंत सिंह का 82 वर्ष की आयु में निधन

पूर्व केंद्रीय मंत्री जसवंत सिंह का 82 वर्ष की आयु में निधन

Jaswant Singh, who was from Rajasthan, had served as India's foreign minister, defense minister and finance minister. Fo

2 min27 Sept
Squares of a Sorted Array - Array - Easy - LeetCode

Squares of a Sorted Array - Array - Easy - LeetCode

Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sort

1 min27 Sept
Valid Mountain Array - Array - Easy - LeetCode

Valid Mountain Array - Array - Easy - LeetCode

Given an array A of integers, return true if and only if it is a valid mountain array. Recall that A is a mountain array

1 min27 Sept
Sort Array By Parity II - Array - Easy - LeetCode

Sort Array By Parity II - Array - Easy - LeetCode

Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. Sort th

1 min27 Sept