Convert a LinkedList to a String in Python
The challenge
Preloaded for you is a class, struct, or derived data type Node (depending on the language) used to construct linked lists in this …
329 articles about python development, tools, and best practices
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 in a list of positive integers. If two numbers have the same number of digits, return the first one …
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 →There is a war and nobody knows – the alphabet war!
There are two groups of hostile letters. The tension between left side …
We want to generate a function that computes the series starting from 0 and ending until the given number.
Input: > 6 …
Read Article →Complete the method which accepts an array of integers, and returns one of the following:
"yes, ascending" – if the numbers …You will be given a string that may have mixed uppercase and lowercase letters and your task is to convert that string to either …
Read Article →Remove all duplicate words from a string, leaving only single (first) words entries.
Input:
‘alpha beta beta gamma gamma gamma …
Read Article →ATM machines allow 4 or 6 digit PIN codes and PIN codes cannot contain anything but exactly 4 digits or exactly 6 digits.
If the …
Read Article →Take 2 strings s1 and s2 including only letters from ato z. Return a new sorted string, the longest possible, containing distinct …
Given 2 strings, a and b, return a string of the form short+long+short, with the shorter string on the outside and the longer string on …
Define a method hello that returns “Hello, Name!” to a given name, or says Hello, World! if name is not given (or passed as …
What if we need the length of the words separated by a space to be added at the end of that same word and have it returned as an array? …
Read Article →Write a function that reverses the words in a given string. A word can also fit an empty string. If this is not clear enough, here are …
Read Article →Define a function that removes duplicates from an array of numbers and returns it as a result.
The order of the sequence has to stay the …
Read Article →The company you work for has just been awarded a contract to build a payment gateway. In order to help move things along, you have …
Read Article →Write a function that always returns 5
Sounds easy right? Just bear in mind that you can’t use any of the following characters: …
Read Article →Implement a function named generateRange(min, max, step), which takes three arguments and generates a range of integers from min to max, …
Read Article →Complete the function that takes a non-negative integer n as input, and returns a list of all the powers of 2 with the exponent ranging …
Create a function that takes in an id and returns the planet name.
Option 1:
def get_planet_name(id): …
Read Article →
If you want to create a directory in Python, but only if it doesn’t exist, you have the following option.
This comes up constantly when writing …
Read Article →