How to Sort a List of Numbers in Python
The challenge
Finish the solution so that it sorts the passed-in array/list of numbers. If the function passes in an empty array/list or null/None …
Read Article →323 articles about python development, tools, and best practices
Finish the solution so that it sorts the passed-in array/list of numbers. If the function passes in an empty array/list or null/None …
Read Article →Count the number of occurrences of each character and return it as a list of tuples in order of appearance. For empty output return an …
Read Article →Given a sequence of numbers, find the largest pair sum in the sequence.
For example
[10, 14, 2, 23, 19] --> 42 (= 23 + 19)
[99, 2, …
Read Article →
Consider the word "abode". We can see that the letter a is in position 1 and b is in position 2. In the alphabet, a and b are …
Find the sum of the odd numbers within an array, after cubing the initial integers. The function should return None if any of the values …
Given a positive integer n, calculate the following sum:
n + n/2 + n/4 + n/8 + ...
All elements of the sum are the results of integer …
Read Article →Preloaded for you is a class, struct, or derived data type Node (depending on the language) used to construct linked lists in this …
Find the number with the most digits.
If two numbers in the argument array have the same number of digits, return the first one in the …
Read Article →You will be given an array and a limit value. You must check that all values in the array are below or equal to the limit value. If they …
Given an array of integers, Find the maximum product obtained from multiplying 2 adjacent numbers in the array.
You are given an array of numbers in which two numbers occur once and the rest occur only twice. Your task is to return the sum of the …
Read Article →Given a two-dimensional array of integers, return the flattened version of the array with all the integers in the sorted (ascending) …
Read Article →