This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Unidirectional linked data structure | |
* @author smallyu | |
* @date 2019/10/23 13:22 | |
*/ | |
public class ListNode { | |
int val; | |
ListNode next; | |
ListNode(int x) { | |
val = x; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @description Sequence binary tree structure | |
* @author smallyu | |
* @date 2019/11/4 10:20 | |
*/ | |
class TreeNode { | |
int val; | |
TreeNode left; | |
TreeNode right; | |
TreeNode(int x) { val = x; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param Array | |
* @return Map | |
*/ | |
var getCharNumByArray = (arr) => { | |
var m = new Map() | |
arr.map(i => { | |
if (m.get(i) == undefined) { | |
m.set(i, 1) | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
@desc get sum by two string | |
@param string s1 | |
@param string s2 | |
@return string | |
""" | |
def sumByString(s1, s2): | |
s1 = s1.rjust(len(s2), '0') | |
s2 = s2.rjust(len(s1), '0') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
@desc quick sort python version | |
@param List arr | |
@return List arr | |
""" | |
def quickSort(arr, left=None, right=None): | |
# default parameter | |
if left == None or right == None: | |
left = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 验证身份证号码的算法 | |
// 可以根据规则找出校验位合规的身份证号 | |
let generatorIdNumber = (x) => { | |
// 目前是 16位 + 2位 | |
let str = '1111111111111111' + x | |
// 字符值 | |
let a = str.split('').map(i => parseInt(i)) | |
// 权重银子 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-shortcut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sonatype.bookmark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daily-issue.bookmark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome-bookmark-archive |
OlderNewer