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β¦
Ex-Union Minister Jaswant Singh Dies At 82.Saddened By Demise,Says PM
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β¦