How to use file masking in IntelliJ IDEA (Updated)Intellij Idea is a popular Java IDE. But usually, a java project may contain different kinds of files as well. For example in my case, we…Jun 13, 2021Jun 13, 2021
8. Majority ElementGiven an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.Oct 20, 2020Oct 20, 2020
7. Binary SearchGiven a sorted (in ascending order) integer array nums of n elements and a target value, write a function to search target in nums. If…Oct 20, 2020Oct 20, 2020
6. Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.Oct 20, 2020Oct 20, 2020
0–1 Knapsack Problem — Techie DelightIn 0–1 Knapsack problem, we are given a set of items, each with a weight and a value and we need to determine the number of each item to…Oct 20, 2020Oct 20, 2020
1. Fibonacci NumberThe Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two…Oct 20, 2020Oct 20, 2020
5. Binary Tree Preorder Traversal(Recursive)Given the root of a binary tree, return the preorder traversal of its nodes' values.Oct 20, 2020Oct 20, 2020
Binary Tree Preorder Traversal (Iterative)Given the root of a binary tree, return the preorder traversal of its nodes' values.Oct 20, 2020Oct 20, 2020
3. Find Level Order Traversal of a Binary Tree.Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).Oct 19, 2020Oct 19, 2020
Lowest Common Ancestor of a Binary TreeGiven a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.Oct 19, 2020Oct 19, 2020
5. Single NumberGiven a non-empty array of integers, every element appears twice except for one. Find that single one.Oct 2, 2020Oct 2, 2020
4. Contains DuplicateGiven an array of integers, find if the array contains any duplicates.Oct 2, 2020Oct 2, 2020
3. Rotate ArrayGiven an array, rotate the array to the right by k steps, where k is non-negative.Oct 2, 2020Oct 2, 2020
2. Best Time to Buy and Sell Stock IISay you have an array prices for which the ith element is the price of a given stock on day i.Oct 2, 2020Oct 2, 2020
1. Remove Duplicates from Sorted ArrayGiven a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length.Oct 1, 2020Oct 1, 2020
5 Myths about PASSION and CAREER in IndiaIn defence of following the conventional path(the road more travelled)May 6, 2020May 6, 2020
Why retail investor lose money in the stock marketAccording to a study, Retail investor's combined return in stock market over a period of 5 years was -4.5%. So the big question is, why…May 6, 2020May 6, 2020