leetcode tips

tips 在遍历时就max,min比较结果 返回的结果不计入空间花费 python str.isdigit() 正面不好解决时,从反面……

Golang Map的一些陷阱

通过结构体查询map 指针类型结构体 1type chunkType struct { 2 isUseOrderBy bool 3 isRoomBreak bool 4 a int 5} 6 7func pointerKey() { 8 m := make(map[*chunkType]int) 9 key :=……

Intresting Sql

字段升序,同时null值在非null值后面 如果只是根据字段升序 1select id,null_field from activity order by null_field; 2 3+----+------------+ 4| id……

检测图是否有环的各种方法

无向图 bfs 1from collections import deque 2 3def isCycle(n, d): 4 def bfs(start, visited): 5 q = deque([(start, None)]) 6 while len(q) > 0: 7 cur, parent = q.popleft() 8 if cur in visited: 9 return True 10 visited.add(cur) 11……