How to Perform Frog Jumping in Python
The challenge
You have an array of integers and have a frog at the first position
[Frog, int, int, int, ..., int]
The integer itself may tell you the …
Read Article →324 articles about python development, tools, and best practices
You have an array of integers and have a frog at the first position
[Frog, int, int, int, ..., int]
The integer itself may tell you the …
Read Article →Write the following function:
def area_of_polygon_inside_circle(circle_radius, number_of_sides):
It should calculate the area of a …
Read Article →You are developing an image hosting website.
You have to create a function for generating random and unique image filenames.
Create a …
Read Article →Given string s, which contains only letters from a to z in lowercase.
A set of the alphabet is given by abcdefghijklmnopqrstuvwxyz. …
Find the longest substring in alphabetical order.
Example:
the longest alphabetical substring in "asdfaaaabbbbcttavvfffffdf" …
Write a function that takes in a binary string and returns the equivalent decoded text (the text is ASCII encoded).
Each 8 bits on the …
Read Article →Given a triangle of consecutive odd numbers:
1
3 5
7 9 11
13 15 17 19
21 23 …
Read Article →
Write a function that takes a shuffled list of unique numbers from 1 to n with one element missing (which can be any number including n …
Given an integer as input, can you round it to the next (meaning, “higher”) multiple of 5?
Examples:
input: output:
0 …
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. …
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 →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 →There is an array of strings. All strings contain similar letters except one. Try to find it!
find_uniq([ 'Aa', 'aaa', …
Read Article →
Complete the function/method so that it takes a PascalCase string and returns the string in snake_case notation. Lowercase characters …
When working with color values it can sometimes be useful to extract the individual red, green, and blue (RGB) component values for a …
Read Article →