@saberazinia
Nothing here yet.
Nothing here yet.
Sep 27, 2025 · 2 min read · The Fast & Slow Pointers (also called the tortoise and hare algorithm) is a clever technique often used in linked list and array problems to detect cycles, find midpoints, or solve problems efficiently in linear time with constant space. Here’s the i...
Join discussion
Sep 17, 2025 · 2 min read · Two Pointers Definition: Use two indices to traverse an array/string, either from opposite ends (left/right) or at different speeds. Key Idea: Reduce search space or compare elements without scanning everything twice. Typical Uses: Check if array...
Join discussionSep 14, 2025 · 2 min read · Definition: A specific type of two-pointers where the pointers define a window (subarray or substring), and this window slides (expands/shrinks) to maintain some property. Common Usage: Substring or subarray problems Problems involving "longest", "...
Join discussionAug 22, 2025 · 3 min read · The Graph → The Python code to find the shortest path in the above ⬆️ graph → from collections import deque from typing import List, Tuple, Optional def bfs(n: int, graph: List[List[int]], source: int) -> Tuple[List[float], List[int]]: """ ...
Join discussion