## Palindrome integer composition in Java

The challenge The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2… Read More »Palindrome integer composition in Java

The challenge The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2… Read More »Palindrome integer composition in Java

The challenge Implement a function that receives two IPv4 addresses, and returns the number of addresses between them (including the first one, excluding the last… Read More »Count IP Addresses in Java

The challenge Given two different positions on a chess board, find the least number of moves it would take a knight to get from one… Read More »Shortest Knight Path in Java

The challenge Write a function that makes a list of strings representing all of the ways you can balance n pairs of parentheses Examples The solution in… Read More »All Balanced Parentheses in Java

The challenge Your task in order to complete this challenge is to write a function which formats a duration, given as a number of seconds,… Read More »Human readable duration format in Java

The challenge Consider the following expansion: Given a string, return the expansion of that string. Input will consist of only lowercase letters and numbers (1… Read More »Simple string expansion in Java

The challenge A Hamming number is a positive integer of the form 2i3j5k, for some non-negative integers i, j, and k. Write a function that computes the nth smallest Hamming number.… Read More »Hamming Numbers in Java

The challenge Consider the following array: If we join these blocks of numbers, we come up with an infinite sequence which starts with 112123123412345123456…. The list… Read More »Block sequence in Java

The challenge Create a RomanNumerals class that can convert a roman numeral to and from an integer value. It should follow the API demonstrated in… Read More »Roman Numerals Helper in Java

The challenge Given a number of points on a plane, your task is to find two points with the smallest distance between them in linearithmic O(n… Read More »Closest pair of points in linearithmic time in Java

The challenge Given a square matrix (i.e. an array of subarrays), find the sum of values from the first value of the first array, the… Read More »Find sum of top-left to bottom-right diagonals in Java

The challenge You will be given a list of strings representing nodes in a rooted tree. A visual representation of a very simple rooted tree could… Read More »Sweeping trees in Java

The challenge A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence “The quick brown… Read More »Detect Pangram in Java

The challenge In this challenge you are given a string for example: Your task is to remove everything inside the parentheses as well as the… Read More »Remove the parentheses in Java

The challenge Return the century of the input year. The input will always be a 4 digit string, so there is no need for validation.… Read More »What century is it in Java

The challenge An ordered sequence of numbers from 1 to N is given. One number might have deleted from it, then the remaining numbers were… Read More »Lost number in number sequence in Java

The challenge In this challenge, we are going to reverse a string while maintaining the spaces (if any) in their original place. For example: More… Read More »Simple string reversal in Java

The challenge Take the following IPv4 address: 128.32.10.1 This address has 4 octets where each octet is a single byte (or 8 bits). 1st octet 128 has the… Read More »int32 to IPv4 in Java

The challenge The drawing shows 6 squares the sides of which have a length of 1, 1, 2, 3, 5, 8. It’s easy to see… Read More »Perimeter of squares in a rectangle in Java

The challenge Number is a palindrome if it is equal to the number with digits in reversed order. For example, 5, 44, 171, 4884 are palindromes, and 43, 194, 4773 are not. Write a… Read More »Palindrome chain length in Java

The challenge You are given an array of strings and your task is to remove all consecutive duplicate letters from each string in the array.… Read More »String array duplicates in Java

The challenge Given a list of numbers, determine whether the sum of its elements is odd or even. Give your answer as a string matching “odd” or “even”.… Read More »Even or Odd Array Sum in Java

The challenge In this challenge, you have to create all permutations of an input string and remove duplicates if present. This means you have to… Read More »String Permutations in Java

The challenge You will be given a certain array of length n, such that n > 4, having positive and negative integers but there will be no… Read More »Remove a Specific Element of an Array in Java

The challenge Consider the numbers 6969 and 9116. When you rotate them 180 degrees (upside down), these numbers remain the same. To clarify, if we write them down on a… Read More »Upside down numbers in Java