Skip to content

Instantly share code, notes, and snippets.

View ascherj's full-sized avatar
🎯
Focusing

Jake Ascher ascherj

🎯
Focusing
View GitHub Profile

πŸ§‘β€πŸ’» Interviewer Guide: Find the Difference (UMPIRE Method)

https://leetcode.com/problems/find-the-difference/

πŸ“Œ Problem Statement

Given two strings s and t where t is generated by shuffling string s and adding one letter at a random position,
Return the letter that was added to t.


🧭 U β€” Understand the Problem

πŸ§‘β€πŸ’» Interviewer Guide: Ransom Note (UMPIRE Method)

https://leetcode.com/problems/ransom-note/

πŸ“Œ Problem Statement

Given two strings ransomNote and magazine,
Return True if ransomNote can be constructed using the letters from magazine, False otherwise.

Each letter in magazine can only be used once in ransomNote.


@ascherj
ascherj / longest_common_prefix.md
Created October 30, 2025 04:21
πŸ§‘β€πŸ’» Interviewer Guide: Longest Common Prefix (UMPIRE Method)

πŸ§‘β€πŸ’» Interviewer Guide: Longest Common Prefix (UMPIRE Method)

https://leetcode.com/problems/longest-common-prefix/

πŸ“Œ Problem Statement

Given an array of strings strs.
Return the longest common prefix string amongst an array of strings.
If there is no common prefix, return an empty string "".


@ascherj
ascherj / find_the_index_of_the_first_occurrence_in_a_string.md
Created October 30, 2025 04:18
πŸ§‘β€πŸ’» Interviewer Guide: Find the Index of the First Occurrence in a String (UMPIRE Method)

πŸ§‘β€πŸ’» Interviewer Guide: Minimum Depth of Binary Tree (UMPIRE Method)

https://leetcode.com/problems/minimum-depth-of-binary-tree/

πŸ“Œ Problem Statement

Given the root of a binary tree, Return its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.

πŸ§‘β€πŸ’» Interviewer Guide: Binary Tree Level Order Traversal (UMPIRE Method)

https://leetcode.com/problems/binary-tree-level-order-traversal/

πŸ“Œ Problem Statement

Given the root of a binary tree,
Return the level order traversal of its nodes' values (i.e., from left to right, level by level).


🧭 U β€” Understand the Problem

πŸ§‘β€πŸ’» Interviewer Guide: Insert into a Binary Search Tree (UMPIRE Method)

https://leetcode.com/problems/insert-into-a-binary-search-tree/

πŸ“Œ Problem Statement

Given the root node of a binary search tree (BST) and a value to insert into the tree,
Return the root node of the BST after the insertion. It is guaranteed that the new value does not exist in the original BST.

Note that there may exist multiple valid ways for the insertion, as long as the tree remains a valid BST after insertion.


πŸ§‘β€πŸ’» Interviewer Guide: Same Tree (UMPIRE Method)

https://leetcode.com/problems/same-tree/

πŸ“Œ Problem Statement

Given the roots of two binary trees p and q,
Return True if they are the same tree, False otherwise.

Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.


πŸ§‘β€πŸ’» Interviewer Guide: Path Sum (UMPIRE Method)

https://leetcode.com/problems/path-sum/

πŸ“Œ Problem Statement

Given the root of a binary tree and an integer targetSum,
Return True if the tree has a root-to-leaf path such that the sum of the node values along the path equals targetSum.

A leaf is a node with no children.


@ascherj
ascherj / bst.py
Last active July 31, 2025 05:42
Binary Search Tree - Node Insertion & Removal Demonstration
class TreeNode:
"""
A node in a Binary Search Tree.
Attributes:
val: The value stored in the node
left: Reference to the left child node
right: Reference to the right child node
"""
def __init__(self, val: int) -> None: