Basic: Remove Vowels

Question: Given a string as an input, please create a function that would remove all vowels (‘a’, ‘i’, ‘u’, ‘e’, ‘o’) from that string. For simplicity, consider all characters in the input string are in lower case. Answer: ๐Ÿ‘ Have fun while coding with Python! ๐Ÿ‘Œ Please subscribe to receive notifications on future challenges. ๐Ÿ’ฌ If you … Read more

Basic: Prime Numbers

Question: Please implement a function to check whether a number is a prime number or not. A prime number is a number greater than one that can be divided (without leaving any reminder) only by one and the number itself. The function simply has one parameter (an integer) and a boolean input stating whether the … Read more

Challenge: Target Sum

Question: Find two indexes from a list whose values are summed up to a predefined target number. Input: A list of integers and a target number. Output: another list containing two (or a pair of) indexes of the input list whose values summed up to the target number. If such pair does not exist, return … Read more

Classic: Bubble Sort

Question Please implement Bubble Sort. Answer Bubble Sort is a basic and simple sorting algorithm. It has O(n^2) complexity. ๐Ÿ‘ Have fun while coding with Python! ๐Ÿ‘Œ Please subscribe to receive notifications on future challenges. ๐Ÿ’ฌ If you have any questions simply write a comment down below.

Classic: Selection Sort

Question: Please implement Selection sort, which is a simple and basic sorting algorithm. It is not very fast. Its complexity is O(n^2). Answer: ๐Ÿ‘ Have fun while coding with Python! ๐Ÿ‘Œ Pleaseย subscribeย to receive notifications on future challenges. ๐Ÿ’ฌ If you have any questions simply write a comment down below.

Classic: Quicksort

Question: Please implement Quicksort Answer: This answer below performs a Quicksort without in-place element swaps. Thus, it requires bigger memory space but results in simpler and easier-to-understand code implementation. Below is a code for Quicksort with in-place swapping. The code is a bit more involved than without in-place swapping (above), but it requires less memory … Read more

Challenge: Diamond

Question: Create a function to print a diamond with the pattern shown in the example below. The function has one input, n, an integer that controls the size of the diamond. Answer: The key here is to first separate the printing of the top and bottom half. Then, for each half, find the pattern of … Read more