Leetcode - 6. Longest Palindromic Substring
DescriptionGiven a string s, return the longest palindromic substring in s. Example 1:123Input: s = "babad"Output: "bab"Explanation: "aba" is also a valid answer.Example 2:12Input: s = "cbbd"Output: "bb"1234Constraints:1 <= s.length <= 1000s consist of only digits and English letters. Approach: Expand Around Center1234567891011121314151617181920212223class Solution: def longestPalindrome(self, s: str) -> str: if not s or len...
Graph
GraphA graph is a data structure that consists of a set of nodes (also called vertices) and a set of edges that connect pairs of nodes. Graphs can be directed or undirected, depending on whether the edges have a direction associated with them. They are used to represent various types of relationships and connections, such as social networks, transportation systems, and communication networks. Types of Graphs Directed Graph (Digraph): A graph where each edge has a direction, indicating a one-w...
Leetcode - 5. Median of Two Sorted Arrays
DescriptionGiven two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). Example 1:123Input: nums1 = [1,3], nums2 = [2]Output: 2.00000Explanation: merged array = [1,2,3] and median is 2.Example 2:123Input: nums1 = [1,2], nums2 = [3,4]Output: 2.50000Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5. 12345678Constraints:nums1.length == mnums2.length == n0 <= m <=...
Tree
TreeA tree is a hierarchical data structure that consists of nodes connected by edges. Each node contains a value and may have child nodes, forming a parent-child relationship. The topmost node is called the root, and nodes with no children are called leaves. Trees are used to represent various types of data, such as organizational structures, file systems, and hierarchical relationships. Types of Trees Binary Tree: A tree where each node has at most two children, referred to as the left and ...
Leetcode - 3. Longest Substring Without Repeating Characters
DescriptionGiven a string s, find the length of the longest substring without duplicate characters. Example 1:123Input: s = "abcabcbb"Output: 3Explanation: The answer is "abc", with the length of 3.Example 2:123Input: s = "bbbbb"Output: 1Explanation: The answer is "b", with the length of 1.Example 3:123Input: s = "pwwkew"Output: 3Explanation: The answer is "wke", with the length of 3.Notice that the answer must be a substring, “pwke”...
mininet
What is Mininet?Mininet is a lightweight network emulator that creates a virtual network with hosts, switches, links, and controllers all on a single machine. It’s widely used in Software-Defined Networking (SDN) research and education.mininet Key Features Lightweight and runs real code (like real Linux hosts) Allows fast prototyping of large networks Integrates well with OpenFlow and SDN controllers like POX, Ryu, and ONOS Installationmininet download Basic Concepts Host: virtual end device...
HashTable
HashTableA hash table is a data structure that implements an associative array, which maps keys to values. It uses a hash function to compute an index into an array of buckets or slots, from which the desired value can be found. Hash FunctionA hash function is a function that takes an input (or “key”) and returns a fixed-size string of bytes. The output is typically a hash code that represents the input data. A good hash function should have the following properties: Deterministic: The same ...
Leetcode - 2. Add Two Numbers
DescriptionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. Example 1:123Input: l1 = [2,4,3], l2 = [5,6,4]Output: [7,0,8]Explanation: 342 + 465 = 807. Example 2:12Input: l1 = [0], l2 = [0]Output: [0]Example 3:12Input: l1 = [9,9...
Leetcode - 1. Two Sum
DescriptionGiven an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. Example 1:123Input: nums = [2,7,11,15], target = 9Output: [0,1]Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].Example 2:12Input: nums = [3,2,4], target = 6Output: [1,2]Example 3:12Input: nums = [3,3], ...
Using Hexo to Build a Personal Blog
Build Your Own Blog with HexoThis guide walks you through the process of creating a personal blog using Hexo. It includes environment setup, Hexo installation, theme configuration, and running the site locally. 1. Install Development Environment (Node.js)Download and install the LTS version of Node.js from the official website: 🔗 https://nodejs.org/en 2. Install Hexo and Initialize BlogRun the following commands in your terminal: 12345npm install -g hexo-cli # Install Hexo CLI glo...









