原创 SQL GROUP BY 語句分析

GROUP BY 語句是SQL中用來對數據實現分組聚集操作的語句,它可以根據數據表中的一個或多個屬性(列)的不同值把數據分成不同的組,以實現對數據的分組統計等操作。下面是我根據個人學習經驗對該語句做出的分析。 聚集函數 要了解分組

原创 LeetCode #532 K-diff Pairs in an Array

題目 Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. He

原创 Go net/http 主要功能及部分源碼閱讀

http 服務器 客戶端主機使用瀏覽器去訪問一個網站,這個網站的 http 服務器接收到客戶端的請求後向用戶返回所請求的信息,這個工作流程主要包括以下過程: 用戶訪問一個網站的過程就如上圖所示,而在上面這個過程中,在 http

原创 字符串模式匹配:KMP算法講解

一、模式匹配問題的定義 字符串的模式匹配問題指的是:給定一個字符串 S 和一個模式串 P ,搜索模式串 P 在 S 中第一次出現的位置。假設字符串 “BCABAABAABCACAABC ” 爲被搜索的字符串 S ,字符串 “

原创 LeetCode #241 Different Ways to Add Parentheses

題目 Given a string of numbers and operators, return all possible results from computing all the different possible w

原创 LeetCode #207 Course Schedule

題目 There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, f

原创 Pandas 數據結構Series、DataFrame分析

用python進行數據分析時經常要用到pandas庫,爲了以後便於查詢,我對pandas庫的兩個主要數據結構Series和DataFrame的創建和使用方法進行了簡單總結。 Series 從概念上說,Series是一個一維數組。但

原创 LeetCode #718 Maximum Length of Repeated Subarray

題目 Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays. Example

原创 C語言標準庫之

在 C 語言的標準庫 <assert.h> 中主要定義了一個宏函數 void assert (int expression); ,當函數的參數 expression 的值爲 0 時,assert() 函數將會把調用 assert(

原创 LeetCode #714 Best Time to Buy and Sell Stock with Transaction Fee

題目 Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; a

原创 LeetCode #475 Heaters

題目 Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to war

原创 LeetCode #712 Minimum ASCII Delete Sum for Two Strings

題目 Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal. Example 1:

原创 LeetCode #659 Split Array into Consecutive Subsequences

題目 You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into s

原创 LeetCode # 690 Employee Importance

題目 You are given a data structure of employee information, which includes the employee’s unique id, his importance

原创 LeetCode #547 Friend Circles

題目 There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in