Averages of numbers in Java
The challenge
Get the averages of these numbers
Write a method, that gets an array of integer-numbers and return an array of the averages of each …
Read Article →In-depth guides, insights, and best practices for modern software engineering
Write a method, that gets an array of integer-numbers and return an array of the averages of each …
Read Article →Coding decimal numbers with factorials is a way of writing out numbers in a base system that depends on factorials, rather than powers …
Read Article →Return the number (count) of vowels in the given string.
We will consider a, e, i, o, u as vowels for this challenge (but not y).
The …
Read Article →You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the …
Read Article →In the following 6 digit number:
283910
91 is the greatest sequence of 2 consecutive digits.
In the following 10 digit number: …
Read Article →Write a function that takes a positive integer and returns the next smaller positive integer containing the same digits.
For example: …
Read Article →Given an array of integers.
Return an array, where the first element is the count of positives numbers and the second element is sum of …
Read Article →You are given an odd-length array of integers, in which all of them are the same, except for one single number.
Complete the method …
Read Article →In a grid of 4 by 4 squares you want to place a skyscraper in each square with only some clues:
If you have received the package org.junit.jupiter.api deos not exist error when trying to run a JUnit Java Test with Maven, it’s …
You can easily control the column filtering in ag-Grid by using the getFilterInstance and setModel methods associated to the column you need …
Given an array of positive or negative integers
I= [i<sub>1</sub>,..,i<sub>n</sub>]
you have to produce a sorted …
Read Article →Count the number of divisors of a positive integer n.
Random tests go up to n = 500000.
numberOfDivisors(4) == 3 // 1, 2, 4 …
Read Article →
Inspired from real-world Brainf**k, we want to create an interpreter of that language which will support the following instructions: …
Read Article →Write a function that returns the positions and the values of the “peaks” (or local maxima) of a numeric array.
For example, …
Read Article →Write a program that will calculate the number of trailing zeros in a factorial of a given number.
N! = 1 * 2 * 3 * ... * N
Be careful …
Read Article →Consider a “word” as any sequence of capital letters A-Z (not limited to just “dictionary words”). For any word …
Read Article →If you find yourself in a position where you have already committed some files to git, and they are in the remote repository already, but you want to …
Read Article →There is a secret string which is unknown to you. Given a collection of random triplets from the string, recover the original string.
A …
Read Article →A format for expressing an ordered list of integers is to use a comma separated list of either
Complete the solution so that it reverses all of the words within the string passed in.
Example:
ReverseWords.reverseWords("The …
Read Article →
Write a simple CamelCase method for strings.
All words must have their first letter capitalized without spaces.
// …
Read Article →
Create a function that takes an integer as an argument and returns “Even” for even numbers or “Odd” for odd …
Read Article →You need to square every digit of a number and concatenate them.
For example, if we run 9119 through the function, 811181 will come out, …
Read Article →