karsevar / Code_Challenge_Practice

This repository contains all of my completed HackerRank and Leetcode challenge answers with a couple of unittests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Repository Documentation

1️⃣ Repository Summary

The following repository 'Code_Challenge_Practice' is the culmination of all the Leetcode and HackerRank problems that I have attempted and hopefully completed. Each problem within the repository is complete with their respective title (as documentated in the code challenge platform), the code challenge url, the difficulty (as documented in the code challenge platform) ranging from easy to hard, and my solution's time and space complexity calculation in Big O notation.

Each challenge is separated in their own individual files complete with the solution code (either written in Python and JavaScript), test files (if complicable to the challenge), and challenge specific readme.md file (which includes the rationale behind my solution, a more indepth analysis of the space and time complexity of the solution, and what specific places can be improved if one where to attempt the challenge a second time).


Technologies Used

  • Python and JavaScript (specific to the problem or which language I wanted to use to solve the problem).
  • unittest and jest testing libraries for solutions written in Python and JavaScript respectively.

2️⃣ Challenges (HackerRank and Leetcode)

Challenges Table

Title Challenge URL Time Complexity Space Complexity Difficulty
Binary Search Tree: Insertion https://www.hackerrank.com/challenges/binary-search-tree-insertion/problem O(n) O(1) Easy
Tree: Huffman Decoding https://www.hackerrank.com/challenges/tree-huffman-decoding/problem O(n) O(n) Medium
Tree: Top View https://www.hackerrank.com/challenges/tree-top-view/problem O(n) O(n) Easy
Reverse a doubly linked list https://www.hackerrank.com/challenges/reverse-a-doubly-linked-list/problem O(n) O(n) Perhaps because of the call stack Easy
Binary Search Tree: Lowest Common Ancestor https://www.hackerrank.com/challenges/binary-search-tree-lowest-common-ancestor/problem O(n) O(n) Easy
Is This a Binary Search Tree https://www.hackerrank.com/challenges/is-binary-search-tree/problem O(n) O(n) Medium
Maximum Element https://www.hackerrank.com/challenges/maximum-element/problem O(n) O(n) Easy
Queues: A Tale of Two Stacks https://www.hackerrank.com/challenges/ctci-queue-using-two-stacks/problem O(n) O(n + m) Medium
Inserting a Node into a Sorted Doubly Linked List https://www.hackerrank.com/challenges/insert-a-node-into-a-sorted-doubly-linked-list/problem O(n) O(1) Easy
Balanced Brackets https://www.hackerrank.com/challenges/balanced-brackets/problem O(n) O(n) Medium
Plus Minus https://www.hackerrank.com/challenges/plus-minus/problem O(n) O(1) Easy
Swap Nodes Algo https://www.hackerrank.com/challenges/swap-nodes-algo/problem O(nm) O(n) Medium
Equal Stacks https://www.hackerrank.com/challenges/equal-stacks/problem O(n) O(1) Easy
Game of Two Stacks https://www.hackerrank.com/challenges/game-of-two-stacks/problem O(n) O(n) Medium
Linked List Cycle II https://leetcode.com/problems/linked-list-cycle-ii/ O(n) O(1) Medium
Palindrome Linked List https://leetcode.com/problems/palindrome-linked-list/ O(n) O(log(n)) Easy
Grid Search https://www.hackerrank.com/challenges/the-grid-search/problem O(n + m) O(1) Medium
Forming a Magic Square https://www.hackerrank.com/challenges/magic-square-forming/problem O(n^9) O(1) Medium

3️⃣ Contact Information

For anyone who has any questions about the above code challenges or wants share a better solution please contact me at masonkarsevar@gmail.com.

About

This repository contains all of my completed HackerRank and Leetcode challenge answers with a couple of unittests.


Languages

Language:Python 94.8%Language:JavaScript 5.0%Language:HTML 0.2%