Leetcode Diary

9. Palindrome Number

Leetcode Diary

Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: -121 Output: false...

8. String to Integer (atoi)

Leetcode Diary

Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, startin...

7. Reverse Integer

Leetcode Diary

Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note: Assume we are...

6. ZigZag Conversion

Leetcode Diary

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L...

5. Longest Palindromic Substring

Leetcode Diary

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. ...

Kubernetes CNIs

Flannel

CNI(Container Network Interface) Flannel Arch Flannel Features Flannel Packet switching way Overlay Network VXLAN UDP Routing Pros & Cons

4. Median of Two Sorted Arrays

Leetcode Diary

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). You may assume n...

3. Longest Substring Without Repeating Characters

Leetcode Diary

Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Exampl...

2. Add Two Numbers

Leetcode Diary

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and re...

1. Two Sum

Leetcode Diary

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use t...