Skip to content

TheCodingBook

Your one stop shop for Python coding exercises

  • Current Page: Home
  • Basic
  • Classic
  • Challenge
  • Subscribe
  • Current Page: Home
  • Basic
  • Classic
  • Challenge
  • Subscribe

Basic: Find All Duplicate Elements

Question: Please write a function to find all duplicate elements in a list. Input: a list of integers. Output: a set of integers that occur twice...

Continue reading...
February 19, 2022 by AlgoExpert Basic 0

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,...

Continue reading...
February 13, 2022 by AlgoExpert Basic 0

Classic: Fibonacci Sequence

Question: Fibonacci sequence is a sequence of numbers where the number at position i is the sum of the numbers at positions i-1 and i-2. Please...

Continue reading...
February 11, 2022 by AlgoExpert Classic 0

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...

Continue reading...
February 9, 2022 by AlgoExpert Basic 0

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....

Continue reading...
February 7, 2022 by AlgoExpert Challenge 0

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!...

Continue reading...
February 5, 2022 by AlgoExpert Classic 0

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...

Continue reading...
February 3, 2022 by AlgoExpert Classic 0

Challenge: Find Median in Linear Time

Question: A straightforward way to find a median from a list of numbers would be to first sort the list and then pick the middle element....

Continue reading...
February 1, 2022 by AlgoExpert Challenge 0

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...

Continue reading...
January 31, 2022 by AlgoExpert Classic 0

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...

Continue reading...
January 29, 2022 by AlgoExpert Challenge 0
Page 1 of 212»
  • Current Page: Home
  • Basic
  • Classic
  • Challenge
  • Subscribe

TheCodingBook © 2022. All Rights Reserved.

Powered by WordPress. Theme by Alx.