Blog Posts

Century From Year in Java

January 10, 2021

The challenge The first century spans from the year 1 up to and including the year 100, The second – from the year 101 up to and including the year 200, etc.


Read More

Find the Smallest Number in Java

January 9, 2021

The challenge You have a positive number n consisting of digits.


Read More

Convert Array to Tree in Java

January 8, 2021

The challenge You are given a non-null array of integers. Implement the method arrayToTree which creates a binary tree from its values in accordance to their order, while creating nodes by depth from left to right.


Read More

Common Denominators in Java

January 7, 2021

The challenge You will have a list of rationals in the form


Read More

Primes in Numbers in Java

January 6, 2021

The challenge Given a positive number n > 1 find the prime factor decomposition of n.


Read More

Maximum subarray sum in Java

January 5, 2021

The challenge The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers:


Read More

Validate Credit Card Number in Java

January 4, 2021

The challenge Let’s implement the Luhn Algorithm, which is used to help validate credit card numbers.


Read More

Find the unique number using Java

January 3, 2021

The challenge There is an array with some numbers. All numbers are equal except for one.


Read More

Find The Parity Outlier in Java

January 2, 2021

The challenge You are given an array (which will have a length of at least 3, but could be very large) containing integers.


Read More

Find the missing letter using Java

January 1, 2021

The challenge Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array.


Read More

Determine the order of braces is valid using Java

December 31, 2020

The challenge Write a function that takes a string of braces, and determines if the order of the braces is valid.


Read More

[Solved] PKIX path building failed: unable to find valid certification path to requested target

December 30, 2020

The problem It may happen to you that when you try and pull some Java dependencies, you will get the annoying PKIX path building failed: sun.


Read More

How to Find the odd int in Java

December 29, 2020

The challenge Given an array of integers, find the one that appears an odd number of times.


Read More

Count the number of Duplicates in Java

December 28, 2020

The challenge Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string.


Read More

Calculating Simple Max Digit Sum in Java

December 27, 2020

The challenge In this challenge, you will be given an integer n and your task will be to return the largest integer that is <= n and has the highest digit sum.


Read More

The String Combat Challenge in Java

December 26, 2020

The challenge After a long conflict, the rulers of Nek and Glo have decided that a final duel should decide the fate of their countries.


Read More

Solving Single Word Pig Latin in Java

December 25, 2020

The challenge Pig Latin is an English language game where the goal is to hide the meaning of a word from people not aware of the rules.


Read More

Count the Days in Java

December 24, 2020

The challenge Little Annie is very excited for upcoming events. She want’s to know how many days she have to wait for a specific event.


Read More

Java HashMap Create or Increment Value

December 23, 2020

If you are using a HashMap to keep a running total of a series of elements, then you often need to increment a HashMap item, but if it doesn’t exist in the map yet, then you need to rather create it.


Read More

Get the Strongest even number in an interval in Java

December 22, 2020

The challenge A strongness of an even number is the number of times we can successively divide by 2 until we reach an odd number starting with an even number n.


Read More