How to Loop and Combine Three Strings in Java
The challenge
Create a function that will return a string that combines all of the letters of the three inputed strings in groups. Taking the first …
Read Article →In-depth guides, insights, and best practices for modern software engineering
Create a function that will return a string that combines all of the letters of the three inputed strings in groups. Taking the first …
Read Article →
The medians of a triangle are the segments that unit the vertices with the midpoint of their opposite sides. The three medians of a …
Read Article →Given the coordinates of four points in 2D space p1, p2, p3 and p4, return true if the four points construct a square.
The coordinate of …
Read Article →Everybody knows the classic “half your age plus seven” dating rule that a lot of people follow (including myself). …
Read Article →Let’s call any (contiguous) subarray B (of A) a mountain if the following properties hold:
B.length >= 30 …chmod alters the permissions for a file or directory, you could allow full read/write access to a file or directory by running the following command: …
Given an encoded string, return its decoded string.
The encoding rule is: k[encoded_string], where the encoded_string inside the square …
You may find your /var/log/journal directory taking up a lot of disk-space.
How do you go about removing, or deleting all these files under var log …
Given the root of a binary tree, find the maximum value V for which there exist different nodes A and B where V = |A.val - B.val| and A …
Create a function that finds the integral of the expression passed.
In order to find the integral all you need to do is add one to the …
Read Article →Write a function stringy that takes a size and returns a string of alternating '1s' and '0s'.
The string should start with a 1.
A string …
Read Article →Say you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most …
Read Article →Write a method, that will get an integer array as parameter and will process every number from this array.
Return a new array with …
Read Article →"A divisibility rule is a shorthand way of determining whether a given integer is divisible by a fixed divisor without …
Given two strings A and B of lowercase letters, return true if you can swap two letters in A so the result is equal to B, otherwise, …
Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.
To flip an image …
Read Article →Given the root of a binary tree, return the sum of every tree node’s tilt.
The tilt of a tree node is the absolute difference …
Read Article →You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only …
Read Article →You have an initial power of P, an initial score of ``, and a bag of tokens where tokens[i] is the value of the …
Given an array of integers nums and an integer threshold, we will choose a positive integer divisor and divide all the array by it and …
You will be given a vector of strings. You must sort it alphabetically (case-sensitive, and based on the ASCII values of the chars) and …
Read Article →Given a string s, the power of the string is the maximum length of a non-empty substring that contains only one unique character.
Return …
Read Article →Write a function to convert a name into initials. This challenge strictly takes two words with one space in between them.
The output …
Read Article →Sort a linked list using insertion sort.
A graphical example of insertion sort. The partially sorted list (black) initially contains …
Read Article →