How to Keep up the Hoop in Java
The challenge
Alex just got a new hula hoop, he loves it but feels discouraged because his little brother is better than him
Write a program where …
Read Article →342 articles about java development, tools, and best practices
Alex just got a new hula hoop, he loves it but feels discouraged because his little brother is better than him
Write a program where …
Read Article →Bob is working as a bus driver. However, he has become extremely popular amongst the city’s residents. With so many passengers …
Read Article →If you are given the head node in a linked list, write a method that swaps each pair of nodes in the list, then returns the head node of …
Read Article →Neo is somewhere in the Matrix.
public interface Matrix {
public int size();
public int get(int x, int y);
}
You are Morpheus, and …
Read Article →In mathematics, a pandigital number is a number that in a given base has among its significant digits each digit used in the base at …
Read Article →After a hard quarter in the office you decide to get some rest on a vacation. So you will book a flight for you and your girlfriend and …
Read Article →Given String str, return:
The Pied Piper has been enlisted to play his magical tune and coax all the rats out of town.
But some of the rats are deaf and are going …
Read Article →You might know some pretty large perfect squares. But what about the NEXT one?
Complete the findNextSquare method that finds the next …
Create a new file called Application.java and paste the following:
import javax.swing.*;
import java.net.InetAddress;
import …
Read Article →
Write a function that takes an array of numbers (integers for the tests) and a target number. It should find two different items in the …
Read Article →Santa’s senior gift organizer Elf developed a way to represent up to 26 gifts by assigning a unique alphabetical character to each …
Read Article →You are given an input string.
For each symbol in the string if it’s the first character occurrence, replace it with a ‘1’, else replace …
Read Article →Given a variable n,
If n is an integer, Return a string with dash'-'marks before and after each odd integer, but do not begin or end the …
Given two arrays a and b write a function comp(a, b) (orcompSame(a, b)) that checks whether the two arrays have the “same” …
You are given a binary tree. Implement the method findMax which returns the maximal node value in the tree.
For example, the maximum in …
Read Article →The method below is the most simple string search algorithm. It will find the first occurrence of a word in a text string.
haystack = …
Given a lowercase string that has alphabetic characters only and no spaces, return the highest value of consonant substrings. Consonants …
Read Article →Given a string "abc" and assuming that each letter in the string has a value equal to its position in the alphabet, our string …
You will receive an array as a parameter that contains 1 or more integers and a number n.
Here is a little visualization of the process: …
Read Article →Your task is to sort a given string. Each word in the string will contain a single number. This number is the position the word should …
Read Article →It’s very easy to get the current machine name and logged in user using Java.
String username = …
Read Article →
Homebrew is the preferred way to install anything on your Mac.
brew install graalvm/tap/graalvm-ce-java17
Java comes with many different ways to generate random integers, even if you need to specify a lower and upper bound to constrain your required value …
Read Article →