Convert Array to Tree in Java
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,… Read More »Convert Array to Tree in Java
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,… Read More »Convert Array to Tree in Java
The challenge You will have a list of rationals in the form where all numbers are positive ints. You have to produce a result in… Read More »Common Denominators in Java
The challenge Given a positive number n > 1 find the prime factor decomposition of n. The result will be a string with the following… Read More »Primes in Numbers in Java
The challenge The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers: Easy… Read More »Maximum subarray sum in Java
The challenge Let’s implement the Luhn Algorithm, which is used to help validate credit card numbers. Given a positive integer of up to 16 digits, return true if… Read More »Validate Credit Card Number in Java
The challenge There is an array with some numbers. All numbers are equal except for one. Try to find it! It’s guaranteed that array contains… Read More »Find the unique number using Java
The challenge You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array… Read More »Find The Parity Outlier in Java
The challenge Write a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array. You… Read More »Find the missing letter using Java
The challenge Write a function that takes a string of braces, and determines if the order of the braces is valid. It should return true if the… Read More »Determine the order of braces is valid using Java
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:… Read More »Solved: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
The challenge Given an array of integers, find the one that appears an odd number of times. There will always be only one integer that… Read More »How to Find the odd int in Java
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 »Count the number of Duplicates in Java
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… Read More »Calculating Simple Max Digit Sum in Java
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 »The String Combat Challenge in Java
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… Read More »Solving Single Word Pig Latin in Java
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 »Count the Days in Java
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,… Read More »Java HashMap Create or Increment Value
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… Read More »Get the Strongest even number in an interval in Java
The challenge How many times have we been asked this simple question in our daily lives by family, friends and strangers alike? In this challenge… Read More »What time is it? in Java
The challenge You have to build a pyramid. This pyramid should be built from characters from a given string. You have to create the code… Read More »Building a String Pyramid in Java
The challenge Write a simple function that takes polar coordinates (an angle in degrees and a radius) and returns the equivalent cartesian coordinates (rounded to… Read More »Cartesian coordinates from degree angle in Java
The challenge Given an array of integers, arr, find out 2 indices m, n(0<=m<=arr.length-1, 0<=n<=arr.length-1, m<=n), so that as long as all elements in the… Read More »Sort array by sorting its smallest sub-array in Java
The challenge An abundant number or excessive number is a number for which the sum of its proper divisors is greater than the number itself.… Read More »Excessively Abundant Numbers in Java
The challenge Write a function that takes two strings, A and B, and returns the length of the longest possible substring that can be formed from the concatenation… Read More »Unique Substring From Joined Strings in Java
The challenge Convert an integer which is base 10, to a hexadecimal base 16 string. Java provides various built-in options such as Integer.toString(a, 16), or… Read More »Converting from Base 10 to 16 (Decimal to Hex) in Java