LeetCode – Arrays – Element Appearing More Than 25% In Sorted Array
Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time. Return that integer. Example 1: Input:…
Given an integer array sorted in non-decreasing order, there is exactly one integer in the array that occurs more than 25% of the time. Return that integer. Example 1: Input:…
Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: Return the 2D grid after…
Given an integer n. Each number from 1 to n is grouped according to the sum of its digits. Return how many groups have the largest size. Example 1: Input:…
Given an array of integers nums, you start with an initial positive value startValue. In each iteration, you calculate the step by step sum of startValue plus elements in nums…
There are some chips, and the i-th chip is at position chips. You can perform any of the two following types of moves any number of times (possibly zero) on…
Given an array of distinct integers arr, find all pairs of elements with the minimum absolute difference of any two elements. Return a list of pairs in ascending order(with respect…
We will dockerize a Django web application in this post and for this we will consider the django application which we built in the previous post. In my previous post,…
Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9…
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given tree above,…
Given a binary tree, each node has value 0 or 1. Each root-to-leaf path represents a binary number starting with the most significant bit. For example, if the path is…