0.1.3 • Published 7 years ago
go-snippets v0.1.3
Go Snippets
Currently we only offer some snippets for leetcode . below is the snippets table:
prefix | description |
---|---|
absi | abs for int |
maxi | max for int |
mini | min for int |
sumi | sum for ints |
avgi | avg for ints |
maxints | max for ints |
joinints | join ints to string |
limits | MaxInt and MinInt |
contains-str | String slice contains str |
treenode | type TreeNode struct |
dumptree | Dump Tree using level order |
listnode | type ListNode struct |
dumplistnode | Dump ListNode using level order |
reversearr | Reverse Ints Array |
reversestr | Reverse String |
pbasic | Basic file for problem |
pbinarytree | Binary Tree solution file stub |
p1darr | One Dimen Array Basic file stub |
p2darr | One Dimen Array Basic file stub |
And I have also add some slice tricks as snippet below: taken from SliceTricks
prefix | description |
---|---|
range.map | range map |
range.arr | range array, slices |
range.str | range interate over unicode points,not bytes |
slice.av | Slice Append Vector |
slice.copy | Slice Copy |
slice.cut | a = append(a:i, aj:...) |
slice.delete | a = append(a:i, ai+1:...) |
slice.extend | a = append(a, make([]T, j)...) |
slice.insert | a = append(a:i, append([]T{x}, ai:...)...) |
slice.unshift | a = append([]T{x}, a...) |
slice.push | a = append(a, x) |
slice.pop | x, a = a0, a1: |
slice.popback | x, a = alen(a) -1, a:len(a) -1 |
0.1.3
7 years ago