Credit Card Issuer Checking 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 …
342 articles about java development, tools, and best practices
Given a credit card number we can determine who the issuer/vendor is with a few basic knowns.
Complete the function getIssuer() that …
Complete the function to find the count of the most frequent item of an array. You can assume that input is an array of integers. For an …
Read Article →Given an array/list [] of integers, Find the Nth smallest element in this array of integers
Notes
Split a given string into different strings of equal size.
Example:
Split the below string into other strings of size #3 …
Read Article →
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 insensitive. The …
Read Article →Given two numbers and an arithmetic operator (the name of it, as a string), return the result of the two numbers having that operator …
Read Article →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 if one with …
Read Article →You are given a string of n lines, each substring being n characters long. For example:
s = "abcd\nefgh\nijkl\nmnop"
We will …
Read Article →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 …
Write a function which maps a function over the lists in a list:
public static <T,R> R[][] gridMap(Function<T,R> fn, T[][] …
Read Article →
Create a function that differentiates a polynomial for a given value of x.
Your function will receive 2 arguments: a polynomial as a …
Read Article →The task is simply stated. Given an integer n (3 < n < 10<sup>9</sup>), find the length of the smallest list of …
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: Failed to …
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 run it using …
Read Article →Your task, is to create a NxN spiral with a given size.
For example, spiral with size 5 should look like this:
00000 ....0 000.0 0...0 …Read Article →
from Wikipedia:
The longest common subsequence (LCS) problem is the problem of finding the longest subsequence common to all sequences …
Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.
If target is …
Given an integer n, return true if it is a power of three. Otherwise, return false.
An integer n is a power of three, if there exists an …
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0’s and 1’s, and all the …
Complete the function that takes two integers (a, b, where a < b) and return an array of all integers between the input parameters, …
Given a grid of size m x n, calculate the total number of rectangles contained in this rectangle. All integer sizes and positions are …
Read Article →The vowel substrings in the word codewarriors are o,e,a,io. The longest of these has a length of 2. Given a lowercase string that has …
In this challenge, you will be given two strings a and b and your task will be to return the characters that are not common in the two …
In this simple exercise, you will create a program that will take two lists of integers, a and b. Each list will consist of 3 positive …