How to Sort Array by Frequency in Java
The challenge Sort elements in an array by decreasing frequency of elements. If two elements have the same frequency, sort them by increasing value. The… Read More »How to Sort Array by Frequency in Java
The challenge Sort elements in an array by decreasing frequency of elements. If two elements have the same frequency, sort them by increasing value. The… Read More »How to Sort Array by Frequency in Java
The challenge Write a function that receives two strings and returns n, where n is equal to the number of characters we should shift the… Read More »How to Calculate String Rotation in Java
The challenge Compare two strings by comparing the sum of their values (ASCII character code). For comparing treat all letters as UpperCase null should be treated… Read More »Compare Strings by Sum of Chars in Java
The challenge Given two integers a, b, find The sum of them, BUT You are not allowed to use the operators + and – Notes The numbers (a,b) may be positive… Read More »How to Add Two Integers Without Arithmetic Operator in Java
The challenge Count how many arguments a method is called with. Examples The solution in Java code Some languages refer to this as the spread… Read More »Counting Method VarArgs in Java
The challenge You are given a list/array which contains only integers (positive and negative). Your job is to sum only the numbers that are the… Read More »How to Sum Consecutives in Java
The challenge You are given a string. You must replace any occurrence of the sequence coverage by covfefe, however, if you don’t find the word coverage in the string, you… Read More »Replacing Occurences of Words in Java
The challenge Your task is to write a function toLeetSpeak that converts a regular english sentence to Leetspeak. More about LeetSpeak You can read at wiki -> https://en.wikipedia.org/wiki/Leet… Read More »Convert String to LeetSpeak in Java
The challenge Given a credit card number we can determine who the issuer/vendor is with a few basic knowns. Complete the function getIssuer() that will use the… Read More »Credit Card Issuer Checking in Java
The challenge Complete the function to find the count of the most frequent item of an array. You can assume that input is an array… Read More »Find Count of Most Frequent Item in an Array in Java
The challenge Given an array/list [] of integers, Find the Nth smallest element in this array of integers Notes Array/list size is at least 3 . Array/list’s numbers could be a mixture of positives… Read More »Return Nth Smallest Element in Java
The challenge Split a given string into different strings of equal size. Example: Assumptions: The solution in Java code Option 1: Option 2: Option 3:… Read More »Split String into Parts in Java
The challenge Check to see if a string has the same amount of ‘x’s and ‘o’s. The method must return a boolean and be case… Read More »Exes and Ohs in Java
The challenge Given two numbers and an arithmetic operator (the name of it, as a string), return the result of the two numbers having that… Read More »How to make an arithmetic function in Java
Apache POI provides a mechanism to work with Excel documents. However, it has a missing feature when you want to only create a new sheet… Read More »Using Apache POI to Get or Create a Sheet in Excel using Java
The challenge You are given a string of n lines, each substring being n characters long. For example: s = “abcd\nefgh\nijkl\nmnop” We will study the “horizontal” and the “vertical” scaling of… Read More »How to Resolve Scaling Squared Strings in Java
The challenge Let’s call an integer number N ‘green’ if N² ends with all of the digits of N. Some examples: 5 is green, because 5² = 25 and 25 ends with 5. 11 is not green,… Read More »Determine the Last Digits of N^2 == N in Java
The challenge Write a function which maps a function over the lists in a list: Example 1: Example 2: The solution in Java code Option… Read More »How to Map over a List of Lists in Java
The challenge Create a function that differentiates a polynomial for a given value of x. Your function will receive 2 arguments: a polynomial as a string,… Read More »How to Differentiate a Polynomial in Java
The challenge The task is simply stated. Given an integer n (3 < n < 109), find the length of the smallest list of perfect squares which add up… Read More »Find the Sums of Perfect Squares in Java
If you have come across this error when trying to build and deploy your Spring Boot Maven application then this post will help you! Error:… Read More »[Solved] Error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.4:repackage (repackage)
You’ve built a Java project and packaged a .jar file. You are ready to run it outside your IDE, or deploy it somewhere. When you… Read More »[Solved] No main manifest attribute Solution for Jar/Maven/Gradle/Spring Boot
The challenge Your task, is to create a NxN spiral with a given size. For example, spiral with size 5 should look like this: 00000 ….0… Read More »How to Make a Spiral in Java
The challenge from Wikipedia:The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to all sequences in a set of sequences.It… Read More »Find the Longest Common Subsequence in Java
The challenge Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. If target is not found in the array,… Read More »Find First and Last Position of Element in Sorted Array in Java