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
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:…
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…
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…
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…
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…
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…
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…
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…
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…
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 (…
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…
पूर्व केंद्रीय मंत्री जसवंत सिंह का 82 वर्ष की आयु में निधन
Jaswant Singh, who was from Rajasthan, had served as India's foreign minister, defense minister and finance minister. Fo…
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…
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…
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…