Skip to content

A repository containing all my completed coding challenges from coding challenge websites such as Hackerrank, LeetCode or CodeEval. I do not own the rights to the questions and am just cataloging my submissions for the purposes of revision and as an exercise in learning git.

Notifications You must be signed in to change notification settings

aspineonxyz/coding-challenges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Coding Challenges

A repository containing all my completed coding challenges from coding challenge websites such as Hackerrank, LeetCode or CodeEval. I do not own the rights to the questions and am just cataloging my submissions for the purposes of revision and as an exercise in learning git.

NOTE: This is a work in progress, any challenge that is listed has been completed but may still not yet be uploaded as I am making efforts to format all questions and keep the repo tidy.

  1. Two Sum (easy)
  2. Add Two Numbers (medium)
  3. Battleships in a Board (medium)
  4. Max Consecutive Ones (easy)
def binary_search(items, goal):
  if len(items) == 0:
    return False
  mid = len(items) // 2
  if items[mid] == goal:
    return True
  elif items[mid] <= goal:
    return binary_search(items[mid+1:], goal)
  else:
    return binary_search(items[:mid], goal)
  1. Solve Me First
  2. Simple Array Sum
  3. Compare the Triplets
  4. A Very Big Sum
  5. Diagonal Difference
  6. Plus Minus
  7. Staircase
  8. Mini-Max Sum
  9. Birthday Cake Candles
  10. Time Conversion
  1. Grading Students
  2. Apple and Orange
  3. Kangaroo
  4. Between Two Sets
  5. Breaking the Records
  6. Birthday Chocolate
  7. Divisible Sum Pairs
  8. Migratory Birds
  9. Day of the Programmer
  10. Bon Appétit
  11. Sock Merchant
  12. Drawing Book
  13. Counting Valleys
  14. Electronics Shop
  15. Cats and a Mouse
  16. Forming a Magic Square
  17. Picking Numbers
  18. Climbing the Leaderboard
  19. The Hurdle Race
  20. Designer PDF Viewer
  21. Utopian Tree
  1. Super Reduced String
  1. Gemstones
class Node(object):
  def __init__(self, data):
    self.data = data
    self.next = None
  def get_data(self):
    return self.data
  def get_next(self):
    return self.next
  def set_data(self, new_data):
    self.data = new_data
  def set_next(self, new_next):
    self.next = new_next
  1. Arrays - DS
  2. 2D Array - DS
  1. Print the Elements of a Linked List
  2. Insert a Node at the Tail of a Linked List
  3. Insert a node at the head of a linked list
  4. Insert a node at a specific position in a linked list
  5. Delete a Node
  6. Print in Reverse
  7. Reverse a linked list
  8. Compare two linked lists
  9. Merge two sorted linked lists
  10. Get Node Value
  11. Delete duplicate-value nodes from a sorted linked list
  12. Cycle Detection
  13. Find Merge Point of Two Lists
  14. Inserting a Node Into a Sorted Doubly Linked List
  15. Reverse a doubly linked list
Trees
  1. Tree: Preorder Traversal
  2. Tree: Postorder Traversal
  3. Tree: Inorder Traversal
  4. Tree: Height of a Binary Tree
  5. Tree: Top View
  6. Tree: Level Order Traversal
  7. Binary Search Tree: Insertion
  1. Is This a Binary Search Tree?
class Days(object):
  def __init__(self):
    self.day = 0
  def __iter__(self):
    return self
  def __next__(self):
    if self.day == 30:
      raise StopIteration
    else:
      self.day += 1
      return "Day " + str(self.day)

days = Days()
for d in days:
  print(d)
  1. Day 0: Hello, World.
  2. Day 1: Data Types
  3. Day 2: Operators
  4. Day 3: Intro to Conditional Statements
  5. Day 4: Class vs. Instance
  6. Day 5: Loops
  7. Day 6: Let's Review
  8. Day 7: Arrays
  9. Day 8: Dictionaries and Maps
  10. Day 9: Recursion
  11. Day 10: Binary Numbers
  12. Day 11: 2D Arrays
  13. Day 12: Inheritance
  14. Day 13: Abstract Classes
  15. Day 14: Scope
  16. Day 15: Linked List
  17. Day 16: Exceptions - String to Integer
  18. Day 17: More Exceptions
  19. Day 18: Queues and Stacks
  20. Day 19: Interfaces
  21. Day 20: Sorting
  22. Day 21: Generics
  23. Day 22: Binary Search Trees
  24. Day 23: BST Level-Order Traversal
  25. Day 24: More Linked Lists
  26. Day 25: Running Time and Complexity
  27. Day 26: Nested Logic
  28. Day 27: Testing
  29. Day 28: RegEx, Patterns, and Intro to Databases
  30. Day 29: Bitwise AND
class Interviewee(object):
  def __init__(self, name, prep):
    self.name = name
    self.prep = prep
    self.hired = False
  def interview(self, problem):
    difficulty = problem.get_difficulty()
    if difficulty > self.prep:
      self.hired = False
      print("Not hired!")
    else:
      self.hired = True
      print("Hired!")
  def get_name(self):
    return self.name
  def study(self):
    self.prep += 1

class Problem(object):
  def __init__(self, difficulty, description):
    self.difficulty = difficulty
    self.description = description
  def get_description(Self):
    return self.description  
  def get_difficulty(self):
    return self.difficulty

problem1 = Problem(5, "Reverse a binary search tree")
joshua = Interviewee("Joshua Vernon", 7)
joshua.interview(problem1)
problem2 = Problem(9, "Solve the Knapsack problem")
joshua.interview(problem2)
for _ in range(3):
  joshua.study()
problem3 = Problem(9, "Solve the Coin Change problem")
joshua.interview(problem3)
Data Structures
  1. Arrays: Left Rotation
  2. Strings: Making Anagrams
  3. Hash Tables: Ransom Note
  4. Linked Lists: Detect a Cycle
  5. Stacks: Balanced Brackets
  6. Queues: A Tale of Two Stacks
  7. Trees: Is This a Binary Search Tree?
Algorithms
  1. Sorting: Bubble Sort
  2. Sorting: Comparator
print("Hello, World!")
Introduction
  1. Say "Hello, World!" With Python
  2. Reading Raw Input
  3. Python If-Else
  4. Arithmetic Operators
  5. Python: Division
  6. Loops
  7. Write a function
  8. Print Function
Basic Data Types
  1. Lists
  2. Tuples
  3. List Comprehensions
  4. Find the Second Largest Number
  5. Nested Lists
  6. Finding the percentage
Strings
  1. sWAP cASE
  2. String Split and Join
  3. What's Your Name?
  4. Mutations
  5. Find a string
  6. String Validators
  7. Text Alignment
  8. Text Wrap
  9. Designer Door Mat
  10. String Formatting
  11. Alphabet Rangoli
  12. Capitalize!
  13. The Minion Game
  14. Merge the Tools!
Sets
  1. Introduction to Sets
  2. Symmetric Difference
  3. No Idea!
  4. Set .add()
  5. Set .discard(), .remove() & .pop()
  6. Set .union() Operation
  7. Set .intersection() Operation
  8. Set .difference() Operation
  9. Set .symmetric_difference() Operation
  10. Set Mutations
  11. The Captain's Room
  12. Check Subset
  13. Check Strict Superset
Math
  1. Polar Coordinates
  2. Find Angle MBC
  3. Triangle Quest 2
  4. Mod Divmod
  5. Power - Mod Power
  6. Integers Come In All Sizes
  7. Triangle Quest
Itertools
  1. itertools.product()
  2. itertools.permutations()
  3. itertools.combinations()
  4. itertools.combinations_with_replacement()
  5. Compress the String!
Collections
  1. Word Order
Classes
  1. Classes: Dealing with Complex Numbers
  2. Class 2 - Find the Torsional Angle
Built-Ins
  1. Any or All
  2. ginortS
Regex and Parsing
  1. Regex Substitution
System.out.println("Hello, World!");
Introduction
  1. Welcome to Java!
  2. Java Stdin and Stdout I
  3. Java If-Else
  4. Java Stdin and Stdout II
  5. Java Output Formatting
  6. Java Loops I
  7. Java Loops II
  8. Java Datatypes
  9. Java End-of-file
  10. Java Static Initializer Block
  11. Java Int to String
  12. Java Date and Time
  13. Java Currency Formatter
std::cout << "Hello, World!" << std::endl;
Introduction
  1. Say "Hello, World!" With C++
  2. Input and Output
  3. Basic Data Types
  4. Conditional Statements
  5. For Loop
  6. Functions
  7. Pointer
  8. Arrays Introduction

About

A repository containing all my completed coding challenges from coding challenge websites such as Hackerrank, LeetCode or CodeEval. I do not own the rights to the questions and am just cataloging my submissions for the purposes of revision and as an exercise in learning git.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published