原创 sed 去掉所有的換行符

sed 替換所有的換行符,命令如下 echo -e "hello\nworld" | sed ':label;N;s/\n//g;b label' :label; 定位標籤,用來實現跳轉處理,名字隨便取(label),後面

原创 【LeetCode】63. Unique Paths II

問題描述 https://leetcode.com/problems/unique-paths-ii/#/description Follow up for “Unique Paths”: Now consider if some

原创 【LeetCode】59. Spiral Matrix II

問題描述 https://leetcode.com/problems/spiral-matrix-ii/#/description Given an integer n, generate a square matrix fill

原创 【LeetCode】74. Search a 2D Matrix

問題描述 https://leetcode.com/problems/search-a-2d-matrix/#/description Write an efficient algorithm that searches for

原创 【LeetCode】62. Unique Paths

問題描述 https://leetcode.com/problems/unique-paths/#/description A robot is located at the top-left corner of a m x n

原创 【LeetCode】 73. Set Matrix Zeroes

問題描述 https://leetcode.com/problems/set-matrix-zeroes/#/description Given a m x n matrix, if an element is 0, set it

原创 【LeetCode】60. Permutation Sequence

問題描述 https://leetcode.com/problems/permutation-sequence/#/description he set [1,2,3,…,n] contains a total of n! uni

原创 【LeetCode】56. Merge Intervals

問題描述 https://leetcode.com/problems/merge-intervals/#/description Given a collection of intervals, merge all overlap

原创 【LeetCode】72. Edit Distance

問題描述 https://leetcode.com/problems/edit-distance/#/description Given two words word1 and word2, find the minimum nu

原创 【LeetCode】75. Sort Colors

問題描述 https://leetcode.com/problems/sort-colors/#/description Given an array with n objects colored red, white or b

原创 【LeetCode】69. Sqrt(x)

問題描述 https://leetcode.com/problems/sqrtx/#/description Implement int sqrt(int x). Compute and return the square roo

原创 【LeetCode】57. Insert Interval

問題描述 https://leetcode.com/problems/insert-interval/#/description Given a set of non-overlapping intervals, insert a

原创 【LeetCode】64. Minimum Path Sum

問題描述 https://leetcode.com/problems/minimum-path-sum/#/description Given a m x n grid filled with non-negative numbe

原创 【TMux】複製窗口內的文本

首先創建文件:~/.tmux.conf 輸入內容: cat >> ~/.tmux.conf << EOF set-window-option -g mode-keys vi EOF 重新加載tmux配置文件: tmux sou

原创 夏普比率計算

夏普比率的計算公式爲: sharpe&ThickSpace;ratio=(R_p−R_f)σ_psharpe\;ratio= \frac{(R\_p - R\_f)}{σ\_p}sharperatio=σ_p(R_p−R_f)​ R