Why You Are Stuck in Coding

Today I want to address a very controversial topic. I know why you feel stuck and you don’t improve as a coder anymore. You are stuck in coding because you don’t produce enough — you are consuming way too much. It’s an ugly truth and I’m sorry if you feel offended. But it’s nonetheless the … Read more

[Python Powerset] How To Get All Subsets of a Set?

Python Powerset

This is a simple algorithm to find all the powersets of a given set. If you feel like you need to refresh your Python set skills, have a look at my complete guide to Python sets (with Harry Potter examples). What is the Powerset of Set s? The powerset is the set of all subsets … Read more

How to Calculate the Edit Distance in Python

Type “Helo World” into your Google search bar. Google will ask you: “Did you mean: hello world” A simple method to detect these typos is the Levensthein distance (also called edit distance). In fact, Google’s algorithm seems to use some variant of it. (source) By studying this article, you’ll learn about the important practical algorithm … Read more

Iterative vs. Recursive Binary Search Algorithms in Python

In this article, you’ll learn about a basic algorithm, every computer scientist must know: the binary search algorithm. If you just want to try the algorithm in Python, feel free to play with our interactive Python shell: The algorithm has important practical applications in many basic data structures such as sets, trees, dictionaries, bags, bag … Read more

A Simple Python Factorial Program Using Recursion

This article explains a simple and effective way of computing the factorial in a single line of code. The Basics Consider the following problem: There are 20 football teams in England’s premier league. Each team can possibly reach any of the 20 ranks at the end of the season. How many possible rankings exist in … Read more