How to Write a Custom Comparator in Python
Generally, you want to use the built-in sorted() function which takes a custom comparator as its parameter. We need to pay attention to the fact that …
In-depth guides, insights, and best practices for modern software engineering
Generally, you want to use the built-in sorted() function which takes a custom comparator as its parameter. We need to pay attention to the fact that …
Usually, it’s quite easy to delete an AWS WAF, or Web ACL. But sometimes you may come across the following error when attempting to delete the …
Read Article →Let’s say that you have an integer with value of 9271 and you want to sort it either ascending(1279) or descending(9721).
How would you do this …
Read Article →In this tutorial, you will learn how to upgrade PIP.
You will also learn how to check the current version of PIP, as well as downgrade to a previous …
Read Article →In this tutorial, you will learn how to copy a file using Python from a directory to another directory, or if you’re on Windows, then from a …
Read Article →Read Article →Conways’s Game Of Life is a Cellular Automation Method created by John Conway. This game was created with Biology in mind but …
Write a function that, given a string of text (possibly with punctuation and line-breaks), returns an array of the top-3 most occurring …
Read Article →Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. Recently, he has decided to …
Read Article →Complete the solution so that the function will break up camel casing, using a space between words.
You are given a binary tree:
class Node:
def __init__(self, L, R, n):
self.left = L
self.right = R …
Read Article →
Splitting a string in Python is really easy.
You simply take a string and apply the split() method.
"Your String".split()
See some examples …
Read Article →Terraform is a fantastic tool to help automate your infrastructure as code.
Quite a few times however, I have noticed a few strange issues, one of …
Read Article →Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then …
Read Article →Move the first letter of each word to the end of it, then add “ay” to the end of the word. Leave punctuation marks …
Read Article →Sheldon, Leonard, Penny, Rajesh and Howard are in the queue for a “Double Cola” drink vending machine; there are no other …
Read Article →Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (HH:MM:SS)
HH = …Your task is to create a function that turns a string into a Mexican Wave. You will be passed a string and you must return that …
Read Article →This multiples of 3 and multiples of 5 challenge is a variation of the common FizzBuzz question.
If we list all the natural numbers …
Read Article →Read Article →"7777…8?!??!", exclaimed Bob, "I missed it again! Argh!" Every time there's an interesting number coming up, he notices …
Given an array (arr) as an argument complete the function countSmileys that should return the total number of smiling faces.
Rules for a …
Read Article →Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output …
Read Article →Basic instructions on how to set up an SSH server on an Ubuntu 16.04/18.04 EC2 instance.
sudo adduser testuser
Using Python, we want to convert words into numbers. In this challenge, we will explore how to convert a string into an integer.
The strings …
Read Article →Given the triangle of consecutive odd numbers:
1
3 5
7 9 11
13 15 17 19
21 23 …
Read Article →