How to create ArrayList from Array in Java
The problem
If you have a traditional array, that looks something like the following:
A[] array = {new A(1), new A(2), new A(3)};
And you would like …
Read Article →342 articles about java development, tools, and best practices
If you have a traditional array, that looks something like the following:
A[] array = {new A(1), new A(2), new A(3)};
And you would like …
Read Article →Remove all vowels from the string.
Vowels:
a e i o u
A E I O U
Option 1:
public class VowelRemoval {
public …
Read Article →
You are given an array of unique elements, and your task is to rearrange the values so that the first max value is followed by the first …
Read Article →The most basic encryption method is to map a char to another char by a certain math rule. Because every char has an ASCII value, we can …
Read Article →Complete the function that takes an odd integer (0 < n < 1000000
) which is the difference between two consecutive perfect squares, …
When given a string of space-separated words, return the word with the longest length.
If there are multiple words with the longest …
Read Article →You must implement a function that returns the difference between the biggest and the smallest value in a list(lst) received as a …
Read Article →Given a string and an array of integers representing indices, capitalize all letters at the given indices.
Example: …
Read Article →Modify the spacify function so that it returns the given string with spaces inserted between each character.
spacify("hello …
Read Article →
Write a simple regex to validate a username. Allowed characters are:
Length should be between 4 …
Read Article →Given two arrays of strings a1
and a2
return a sorted array r
in lexicographical order of the strings of a1
which are substrings of …
Your task is to add up letters to one letter.
The function will be given an array of single-character Strings, each one being a letter …
Read Article →