原创 LeetCode1319. 連通網絡的操作次數

1319. Number of Operations to Make Network Connected There are n computers numbered from 0 to n-1 connected by ethe

原创 LeetCode1209. 刪除字符串中的所有相鄰重複項 II

1209. Remove All Adjacent Duplicates in String II [Medium] Given a string s, a k duplicate removal consists of choo

原创 string 轉換 LPSTR LPCSTR LPCWSTR

LPCSTR 、LPSTR、 LPWSTR and LPCWSTR爲指向不同類型字符串的指針。 Call c_str() to get a const char * (LPCSTR) from a std::string. It

原创 opencv4.2.0未聲明的標識符CV_WINDOW_AUTOSIZE

環境:OpenCV 4.2.0 #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/core/core.hpp" #include "opencv2/highgui/h

原创 LeetCode946. 驗證棧序列

946. Validate Stack Sequences [Medium] Given two sequences pushed and popped with distinct values, return true if a

原创 LeetCode1267. Count Servers that Communicate(統計參與通信的服務器)

1267. Count Servers that Communicate You are given a map of a server center, represented as a m * n integer matrix

原创 筆試輸入處理

輸入由空格分開時,如1 2 3 4 vector<int> nums; int num; while (cin >> num) nums.push_back(num); 輸入由逗號分開時,如12.1,13.2,1

原创 LeetCode1202. 交換字符串中的元素

1202. Smallest String With Swaps [Medium] You are given a string s, and an array of pairs of indices in the string

原创 LeetCode689. Maximum Sum of 3 Non-Overlapping Subarrays(三個無重疊子數組的最大和)

689. Maximum Sum of 3 Non-Overlapping Subarrays In a given array nums of positive integers, find three non-overlapp

原创 LeetCode1249. 移除無效的括號

1249. Minimum Remove to Make Valid Parentheses [Medium] Given a string s of '(' , ')' and lowercase English charact

原创 LeetCode845. 數組中的最長山脈

845. Longest Mountain in Array [Medium] Let’s call any (contiguous) subarray B (of A) a mountain if the following p

原创 LeetCode791. 自定義字符串排序

791. Custom Sort String S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S

原创 LeetCode1247. 交換字符使得字符串相同

1247. Minimum Swaps to Make Strings Equal [Medium] You are given two strings s1 and s2 of equal length consisting o

原创 VS中設置打開所在文件夾快捷鍵

目的:通過VS瀏覽代碼時,快速打開該文件在資源管理器中的位置。 快捷鍵綁定成功:

原创 LeetCode1222. 可以攻擊國王的皇后

1222. Queens That Can Attack the King On an 8x8 chessboard, there can be multiple Black Queens and one White King.