Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
lbvf50mobile / tribonacci.go
Created April 24, 2024 13:52
Leetcode: 1137. N-th Tribonacci Number.
// Leetcode: 1137. N-th Tribonacci Number.
// https://leetcode.com/problems/n-th-tribonacci-number/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 1 ms, faster than 78.71% of Go online submissions for N-th
// Tribonacci Number.
// Memory Usage: 2.1 MB, less than 68.56% of Go online submissions for N-th
// Tribonacci Number.
@lbvf50mobile
lbvf50mobile / findMinHeightTrees.go
Last active April 24, 2024 12:55
Leetcode: 310. Minimum Height Trees.
// Leetcode: 310. Minimum Height Trees.
// https://leetcode.com/problems/minimum-height-trees/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 104 ms, faster than 38.61% of Go online submissions for Minimum
// Height Trees.
// Memory Usage: 18.5 MB, less than 5.94% of Go online submissions for Minimum
// Height Trees.
@lbvf50mobile
lbvf50mobile / openLock.py
Created April 22, 2024 16:50
Leetcode: 752. Open the Lock.
# Leetcode: 752. Open the Lock.
# https://leetcode.com/problems/open-the-lock/
# = = = = = = = = = = = = = =
# Accepted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 292 ms, faster than 90.77% of Python3 online submissions for Open
# the Lock.
# Memory Usage: 18 MB, less than 50.54% of Python3 online submissions for Open
# the Lock.
@lbvf50mobile
lbvf50mobile / validPath.go
Created April 21, 2024 16:47
Leetcode: 1971. Find if Path Exists in Graph.
// Leetcode: 1971. Find if Path Exists in Graph.
// https://leetcode.com/problems/find-if-path-exists-in-graph/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 299 ms, faster than 55.81% of Go online submissions for Find if
// Path Exists in Graph.
// Memory Usage: 55.9 MB, less than 58.43% of Go online submissions for Find
// if Path Exists in Graph.
@lbvf50mobile
lbvf50mobile / findFarmland.go
Last active April 21, 2024 09:07
Leetcode: 1992. Find All Groups of Farmland.
// Leetcode: 1992. Find All Groups of Farmland.
// https://leetcode.com/problems/find-all-groups-of-farmland/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 134 ms, faster than 30.00% of Go online submissions for Find All
// Groups of Farmland.
// Memory Usage: 25.7 MB, less than 20.00% of Go online submissions for Find
// All Groups of Farmland.
@lbvf50mobile
lbvf50mobile / numIslands.go
Created April 19, 2024 15:41
Leetcode: 200. Number of Islands
// Leetcode: 200. Number of Islands.
// https://leetcode.com/problems/number-of-islands/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 4 ms, faster than 76.52% of Go online submissions for Number of
// Islands.
// Memory Usage: 6.1 MB, less than 28.58% of Go online submissions for Number
// of Islands.
@lbvf50mobile
lbvf50mobile / islandPerimeter.go
Last active April 21, 2024 12:16
Leetocde: 463. Island Perimeter.
// Leetcode: 463. Island Perimeter.
// https://leetcode.com/problems/island-perimeter/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 45 ms, faster than 61.37% of Go online submissions for Island
// Perimeter.
// Memory Usage: 8.1 MB, less than 6.51% of Go online submissions for Island
// Perimeter.
@lbvf50mobile
lbvf50mobile / smallestFromLeaf.py
Created April 17, 2024 16:51
Leetcode: 988. Smallest String Starting From Leaf.
# Leetcode: 988. Smallest String Starting From Leaf.
# https://leetcode.com/problems/smallest-string-starting-from-leaf/
# = = = = = = = = = = = = = =
# Accepted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 39 ms, faster than 79.79% of Python3 online submissions for
# Smallest String Starting From Leaf.
# Memory Usage: 17.7 MB, less than 88.96% of Python3 online submissions for
# Smallest String Starting From Leaf.
@lbvf50mobile
lbvf50mobile / addOneRow.go
Last active April 16, 2024 19:59
Leetcode: 623. Add One Row to Tree.
// Leetcode: 623. Add One Row to Tree.
// https://leetcode.com/problems/add-one-row-to-tree/
package main
/**
* Definition for a binary tree node.
* type TreeNode struct {
* Val int
* Left *TreeNode
@lbvf50mobile
lbvf50mobile / sumNumbers.go
Created April 15, 2024 10:38
Leetcode: 129. Sum Root to Leaf Numbers.
// Leetcode: 129. Sum Root to Leaf Numbers.
// https://leetcode.com/problems/sum-root-to-leaf-numbers/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 0 ms, faster than 100.00% of Go online submissions for Sum Root to
// Leaf Numbers.
// Memory Usage: 2.4 MB, less than 6.15% of Go online submissions for Sum Root
// to Leaf Numbers.