Longest Alphabetical Substring in Java
The challenge
Find the longest substring of a string where characters are in non-decreasing alphabetical order. If multiple substrings share the …
Read Article →345 articles about java development, tools, and best practices
Find the longest substring of a string where characters are in non-decreasing alphabetical order. If multiple substrings share the …
Read Article →Given a word (a string of lowercase letters), return all its permutations in alphabetical order. Do not use built-in permutation …
Read Article →Given an array of positive integers, return the number with the most digits. If two or more numbers share the highest digit count, …
Read Article →An API (Application Programming Interface) is a set of rules and protocols that allows different software applications to …
Read Article →Welcome to our Programming Languages Series! In this series, we’ll explore various programming languages, understand their …
Read Article →In the vast landscape of programming languages, Python and Java have emerged as titans, offering robust solutions for a wide range of applications. …
Read Article →Learning Java in one day is not a realistic goal, as Java is a complex programming language that requires time and practice to master. However, here …
Read Article →Reverse Number is a number which is the same when reversed.
For example, the first 20 Reverse Numbers are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, …
Read Article →
Write a function called sumIntervals/sum_intervals() that accepts an array of intervals, and returns the sum of all the interval …
If you need to compile multiple Java files using a single command, then you can do the following.
First, it’s good to learn how to compile a …
Read Article →If you need to convert JSON to a Java Object, then you can do one of the following:
Gsonimport com.google.gson.Gson;
public class …
Read Article →
If you need to calculate the powers of Integers in Java, then you can do one of the following:
for loopspublic class Power { …
Read Article →
If you need to get today’s date in Java, then you can do one of the following:
LocalDateimport java.time.LocalDate;
public …
Read Article →
Let’s say you have a Java project as follows:
package ms.ao.something;
public class MyProject {
public static void main(String...args) …
Read Article →
If you need to read a file line by line in Java, then you can use one of the following three (3) options.
You can use the FileReader and …
You can use Java’s StringBuilder to create and manipulate Strings as follows:
StringBuilder sb = new StringBuilder(); …
Read Article →
If you need to convert an array to a string in Java, then you could look at a solution like this:
String stringArray[] = {"Hello ", " …
Read Article →
In short, you can just do this:
new String(Base64.getEncoder().encode(bytes));
In Java 8 and above, you …
Read Article →Java provides many ways to generate random strings.
public void generatingRandomAlphanumericString_ApacheCommons() { …
Read Article →
In this challenge, you parse RGB colors represented by strings. The formats are primarily used in HTML and CSS. Your task is to …
Read Article →Simple transposition is a basic and simple cryptography technique. We make 2 rows and put first a letter in Row 1, the second in Row 2, …
Read Article →The objective is to return all pairs of integers from a given array of integers that have a difference of 2.
The resulting array should …
Read Article →Write a simple parser that will parse and run Deadfish.
Deadfish has 4 commands, each 1 character long:
i increments the value …You will be given a number and you will need to return it as a string in Expanded Form.
Examples:
Challenge.expandedForm(12); // Should …
Read Article →