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

Missing Number - Array - Easy - LeetCode
Featured

Missing Number - Array - Easy - LeetCode

Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1: Input: [3,0,1]Output: 2Example 2: Input: [9,6,4,2,3,5,7,0,1]Output: 8No

1 min read25 Sept 2020
Read article
Contains Duplicate II - Array - Easy - LeetCode

Contains Duplicate II - Array - Easy - LeetCode

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such t

1 min25 Sept
Contains Duplicate - Array - Easy - LeetCode

Contains Duplicate - Array - Easy - LeetCode

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value app

1 min25 Sept
Rotate Array - Array - Easy - LeetCode

Rotate Array - Array - Easy - LeetCode

Given an array, rotate the array to the right by k steps, where k is non-negative. Follow up: Try to come up with as man

1 min25 Sept
Majority Element - Array - Easy - LeetCode

Majority Element - Array - Easy - LeetCode

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊

1 min25 Sept
Best Time to Buy and Sell Stock II - Array - Easy - LeetCode

Best Time to Buy and Sell Stock II - Array - Easy - LeetCode

Say you have an array prices for which the ith element is the price of a given stock on day i. Design an algorithm to fi

1 min25 Sept
Pascal's Triangle II - Array - Easy - LeetCode

Pascal's Triangle II - Array - Easy - LeetCode

Given an integer rowIndex, return the rowIndexth row of Pascal's triangle. Notice that the row index starts from 0. In P

1 min25 Sept
Pascal's Triangle - Array - Easy - LeetCode

Pascal's Triangle - Array - Easy - LeetCode

Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. In Pascal's triangle, each number

1 min25 Sept
Merge Sorted Array - Array - Easy - LeetCode

Merge Sorted Array - Array - Easy - LeetCode

public class Solution { public void Merge(int[] nums1, int m, int[] nums2, int n) { int i=m-1; int j

1 min25 Sept
Search Insert Position - Array - Easy - LeetCode

Search Insert Position - Array - Easy - LeetCode

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it woul

1 min25 Sept
Remove Element - Array - Easy - LeetCode

Remove Element - Array - Easy - LeetCode

Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not alloc

1 min25 Sept
व्हाट्सएप का डिफेंस एमिड रो ओवर लीक चैट्स इन ड्रग्स प्रोब

व्हाट्सएप का डिफेंस एमिड रो ओवर लीक चैट्स इन ड्रग्स प्रोब

The central agency has summoned actors Deepika Padukone and Shraddha Kapoor on basis of chats dating back to 2017, acces

2 min25 Sept
Remove Duplicates from Sorted Array - Array - Easy - LeetCode

Remove Duplicates from Sorted Array - Array - Easy - LeetCode

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new len

1 min24 Sept
Longest Palindrome Subsequence - Dynamic Porgramming

Longest Palindrome Subsequence - Dynamic Porgramming

Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is

1 min29 Aug
Sum of Even Numbers After Queries - Array - Easy - LeetCode

Sum of Even Numbers After Queries - Array - Easy - LeetCode

We have an array A of integers, and an array queries of queries. For the i-th query val = queries[i][0], index = querie

3 min22 Jun