PROBLEM DESCRIPTION You are given an integer array A. You have to find the number of occurences of each number. Return an array containing only the occurences with the smallest value’s occurence f...
Getting Started With Spring
🌱 Spring Framework - 101 🌱 If you are looking for a comprehensive and easy-to-follow guide to learn the Spring Framework, you have come to the right place. This blog page covers a wide range of to...
Binary Tree Longest Consecutive Sequence
PROBLEM DESCRIPTION Given the root of a binary tree, return the length of the longest consecutive sequence path. A consecutive sequence path is a path where the values increase by one along the pa...
Find the Celebrity
PROBLEM DESCRIPTION Suppose you are at a party with n people labeled from 0 to n - 1 and among them, there may exist one celebrity. The definition of a celebrity is that all the other n - 1 people...
Find Permutation
PROBLEM DESCRIPTION A permutation perm of n integers of all the integers in the range [1, n] can be represented as a string s of length n - 1 where: s[i] == 'I' if perm[i] < perm[i + 1], an...
Missing Number In Arithmetic Progression
PROBLEM DESCRIPTION In some array arr, the values were in arithmetic progression: the values arr[i + 1] - arr[i] are all equal for every 0 <= i < arr.length - 1. A value from arr was removed...
First Unique Number
PROBLEM DESCRIPTION You have a queue of integers, you need to retrieve the first unique integer in the queue. Implement the FirstUnique class: FirstUnique(int[] nums) Initializes the object w...
Delete N Nodes After M Nodes of a Linked List
PROBLEM DESCRIPTION You are given the head of a linked list and two integers m and n. Traverse the linked list and remove some nodes in the following way: Start with the head as the current n...
Remove Interval
PROBLEM DESCRIPTION A set of real numbers can be represented as the union of several disjoint intervals, where each interval is in the form [a, b). A real number x is in the set if one of its inte...
Add Bold Tag in String
PROBLEM DESCRIPTION You are given a string s and an array of strings words. You should add a closed pair of bold tag <b> and </b> to wrap the substrings in s that exist in words. ...