How to get the Sum of the First nth Term of a Series in Java
The challenge
Your task is to write a function that returns the sum of the following series up to nth term(parameter).
Series: 1 + 1/4 + 1/7 + 1/10 + …
Read Article →
In-depth guides, insights, and best practices for modern software engineering
Your task is to write a function that returns the sum of the following series up to nth term(parameter).
Series: 1 + 1/4 + 1/7 + 1/10 + …
Read Article →
Wilson primes satisfy the following condition. Let P represent a prime number.
Then ((P-1)! + 1) / (P * P) should give a whole number. …
Create a new AWS EC2 instance, and set the User Script to the following:
This is handy for quick demos or testing — the instance comes up with Apache …
Read Article →Christmas is coming and many people dreamed of having a ride with Santa’s sleigh. But, of course, only Santa himself is allowed to …
Read Article →Return a new array consisting of elements which are multiple of their own index in input array (length > 1).
Examples:
[22, -6, 32, …
Read Article →When provided with a letter, return its position in the alphabet.
Input :: “a”
Ouput :: “Position of alphabet: …
Read Article →Alex just got a new hula hoop, he loves it but feels discouraged because his little brother is better than him
Write a program where …
Read Article →Bob is working as a bus driver. However, he has become extremely popular amongst the city’s residents. With so many passengers …
Read Article →If you are given the head node in a linked list, write a method that swaps each pair of nodes in the list, then returns the head node of …
Read Article →Neo is somewhere in the Matrix.
public interface Matrix {
public int size();
public int get(int x, int y);
}
You are Morpheus, and …
Read Article →In mathematics, a pandigital number is a number that in a given base has among its significant digits each digit used in the base at …
Read Article →If you need to query meta-data information from your running EC2 instance, you can curl the following location:
curl …
Read Article →
The make_looper() function takes a string (of non-zero length) as an argument. It returns a function. The function it returns will …
In this challenge, you will make a function that converts between camelCase, snake_case, and kebab-case.
You must write a function that …
Read Article →Create a function, that accepts an arbitrary number of arrays and returns a single array generated by alternately appending elements …
Read Article →Complete the greatestProduct method so that it’ll find the greatest product of five consecutive digits in the given string of …
Write a function that calculates the least common multiple of its arguments; each argument is assumed to be a non-negative integer. In …
Read Article →Write a class that, when given a string, will return an uppercase string with each letter shifted forward in the alphabet by however …
Read Article →Create a function that transforms any positive number to a string representing the number in words. The function should work for all …
Read Article →Create a function that converts the value of the String to and from Base64 using the ASCII character set.
Do not use built-in functions. …
Read Article →After a hard quarter in the office you decide to get some rest on a vacation. So you will book a flight for you and your girlfriend and …
Read Article →Given String str, return:
Write a function, called sumPPG, that takes two NBA player objects/struct/Hash/Dict/Class and sums their PPG
Examples:
iverson := …
Read Article →
You will be given a number n (where n >= 1) and your task is to find n consecutive odd numbers whose sum is exactly the cube of n. …