• Algorithms 101: What is a Stack

    栈是什么?What is a Stack? A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. This means that the last element added to the stack will be the first one to be removed. Stacks are used in various applications, including expression evaluation, backtracking algorithms, and the undo mechanism…

  • Algorithms 101: What is a Queue

    什么是队列? A queue is a linear data structure that follows the First-In-First-Out (FIFO) principle. This means that the first element added to the queue will be the first one to be removed. Queues are widely used in scenarios where tasks need to be processed in the order they arrive, such…

  • Leetcode: 86 Partition List

    Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. Example: Input: head = [1,4,3,2,5,2],…

  • System Design Interview Questions: How would you design Google Docs System

    谷歌文档系统设计解析 Introduction 介绍 Google Docs is a complex, real-time collaborative platform that allows users to create, edit, and share documents online. Designing a system like Google Docs requires a deep understanding of distributed systems, real-time collaboration, and scalability. In this explanation, we’ll break down the key components involved in the…

  • Bash 101: `curl` Command

    The curl command is an extremely versatile and powerful tool for interacting with web servers and APIs. It is commonly used for tasks such as downloading files, testing API endpoints, automating web requests, and even performing complex data transfers. Mastering curl is essential for developers, sysadmins, and anyone who regularly…

  • Bash 101: `grep` Command

    The grep command is an essential tool in Bash for searching and filtering text. It is highly versatile, with a wide range of options that make it suitable for both simple searches and complex text processing tasks. Whether you’re searching logs, filtering command output, or handling large datasets, grep is…

  • LeetCode: 49 Group Anagrams

    Given an array of strings strs, group the anagrams together. You can return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Example: Input: strs = ["eat","tea","tan","ate","nat","bat"] Output:…

  • Python 101: defaultdict

    defaultdict is a subclass of Python’s built-in dict class. It is part of the collections module and provides all the functionalities of a regular dictionary with an additional feature: if you try to access or modify a key that does not exist in the dictionary, defaultdict automatically creates the key…

  • Python 101: Learning Python Through Code Examples

    Python is known for its simplicity and elegance, making it an excellent language for both beginners and experienced programmers. One of the best ways to learn Python is by solving coding problems and understanding real-world examples. In this blog, we’ll explore a classic problem, "Group Anagrams," and solve it step-by-step…

  • Algorithms 101: Preserving Relative Position in Linked List

    链表分隔问题:保留相对位置 Linked List Partitioning Problem: Preserving Relative Position Given the head of a linked list and a specific value x, the task is to partition the linked list so that all nodes with values less than x appear before nodes with values greater than or equal to x. Additionally, the…