## Sort Binary Tree by Levels using Python

The challenge You are given a binary tree: Your task is to return the list with elements from tree sorted by levels, which means the… Read More »Sort Binary Tree by Levels using Python

The challenge You are given a binary tree: Your task is to return the list with elements from tree sorted by levels, which means the… Read More »Sort Binary Tree by Levels using Python

Splitting a string in Python is really easy. You simply take a string and apply the split() method. “Your String”.split() See some examples of the… Read More »How to Split a String with Python

The challenge Move the first letter of each word to the end of it, then add “ay” to the end of the word. Leave punctuation… Read More »Converting to PigLatin with Python

The challenge This challenge is a variation of the common FizzBuzz question. If we list all the natural numbers below 10 that are multiples of… Read More »Multiples of 3 and 5 with Python

The challenge “7777…8?!??!“, exclaimed Bob, “I missed it again! Argh!” Every time there’s an interesting number coming up, he notices and then promptly forgets. Who doesn’t like… Read More »Solving the “Catching Car Mileage Numbers” Challenge using Python

The challenge Given an array (arr) as an argument complete the function countSmileys that should return the total number of smiling faces. Rules for a smiling face:… Read More »Counting smiley faces with Python

Challenge Using Python, we want to convert words to numbers. In this challenge, we will explore how to convert a string into an integer. The… Read More »How to Convert Numeric Words into Numbers using Python

The challenge Given the triangle of consecutive odd numbers: Calculate the row sums of this triangle from the row index (starting at index 1) e.g.:… Read More »Solve The Triangle of Odd Numbers using Python

The Challenge You probably know the “like” system from Facebook and other pages. People can “like” blog posts, pictures or other items. We want to… Read More »“Who likes it” code Challenge in Python

It took the Python community a long time to move from Python 2 to Python 3. Now as we approach the possible end of Python… Read More »Python 4 New Features Planned

The challenge The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being returned. Valid… Read More »Custom RGB To Hex Conversion with Python

The challenge We want to create a function that will add numbers together when called in succession. We also want to be able to continue… Read More »How to write a Chain Adding Function in Python

The challenge Create a function that takes a positive integer and returns the next bigger number that can be formed by rearranging its digits. For… Read More »Get the next biggest number with the same digits using Python

The challenge As the name may already reveal, it works basically like a Fibonacci, but summing the last 3 (instead of 2) numbers of the… Read More »Solving Tribonacci Sequence with Python

The challenge You are given three piles of casino chips: white, green and black chips: the first pile contains only white chips the second pile… Read More »The Casino Chips Problem Solved with Python

The challenge An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains… Read More »Check if Isogram using Python

The challenge Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an… Read More »Find the Longest Common Prefix using Python

The challenge he count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211… Read More »Count and Say with Python

The challenge Given a non-empty array of digits representing a non-negative integer, increment one to the integer. The digits are stored such that the most significant digit is at… Read More »The Plus One problem solved with Python

The challenge Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could… Read More »Solving the Single Number problem in Python

The challenge You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate the image in-place, which… Read More »Rotate a Matrix List in Python

The challenge Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2,2] Example 2:… Read More »Find the Intersection of Two Arrays in Python

The challenge Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4]… Read More »Rotate an Array K Times in Python

Python has a fantastic feature called slices. It allows you to work with a list, set or string by it’s index items. E.g.: You can… Read More »Python Splices reimplemented in Java

The challenge Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each… Read More »Solving Two Sum in Python