The Array Height Checker Problem in Java
The challenge
Students are asked to stand in non-decreasing order of heights for an annual photo.
Return the minimum number of students that must move …
Read Article →In-depth guides, insights, and best practices for modern software engineering
Students are asked to stand in non-decreasing order of heights for an annual photo.
Return the minimum number of students that must move …
Read Article →Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted …
Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of …
Say you have an array of primitive integers and you want to remove all duplicates.
You can find out how many non-duplicate integers are in the array …
Read Article →Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last …
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 if …
Read Article →Java has a built-in called HashMap. It allows you to store and very quickly retrieve key value pairs.
In Python, this is called a …
Read Article →Given an array nums of integers, return how many of them contain an even number of digits.
Example 1:
Input: nums = [12,345,2,6,7896] …Read Article →
Relational databases first made an appearance in the mid-1970s, between the years 1974 and 1977 with the creation of Ingres and System R which led to …
Read Article →A HashSet is an unordered collection containing unique elements. It has the standard collection operations Add, Remove, Contains, …
In an N by N square grid, each cell is either empty (0) or blocked (1).
A clear path from top-left to bottom-right has length k if and …
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s …
Read Article →From time to time you might have some rather big tables that you want to delete all the data quickly and start afresh.
You have a few options at this …
Read Article →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 find the maximum …
Read Article →CIDR stands for Classless Inter-Domain Routing and is a method for allocating IP addresses as well as for IP routing.
It was introduced in 1993 by the …
Read Article →Below is a quick and easy way to recursively delete all files and folders in a given path using PHP.
function destroy_dir($dir) {
if (!is_dir($dir) …
Read Article →
As a product update; The “Autonomous Distributed Database”, otherwise known as simply ADD has been renamed to Serengeti.
The Serengeti is …
Read Article →This came in very handy for me at one point because I needed to have a certain field in each row 14 characters long, but half of them were only 12 …
Read Article →Need a quick client-side email validation? Below is a simple JavaScript regular expression to validate email addresses. …
Read Article →E.g. URL:<br>http://example.com/?option=1&task=2&listing_id=36&layout=4&table=5#some_hash_value_here
So how would you get the …
Read Article →Artificial Intelligence (AI) is usually defined as the science of making computers do things that require intelligence when done by humans. (Jack …
Read Article →An encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and …
If you look up the term “real-time” in a dictionary, it will tell you that it is the actual time during which …
Read Article →Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.
Example: …
Read Article →