Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
lbvf50mobile / maximumSafenessFactor.py
Created May 15, 2024 16:53
Leetcode: 2812. Find the Safest Path in a Grid.
# Leetcode: 2812. Find the Safest Path in a Grid.
# https://leetcode.com/problems/find-the-safest-path-in-a-grid/
# = = = = = = = = = = = = = =
# Accpeted.
# Thanks God, Jesus Chisrt!
# = = = = = = = = = = = = = =
# Runtime: 3925 ms, faster than 53.43% of Python3 online submissions for Find
# the Safest Path in a Grid.
# Memory Usage: 25.8 MB, less than 93.15% of Python3 online submissions for Find
# the Safest Path in a Grid.
@lbvf50mobile
lbvf50mobile / getMaximumGold.py
Created May 14, 2024 15:57
Leetcode: 1219. Path with Maximum Gold.
# Leetcode: 1219. Path with Maximum Gold.
# https://leetcode.com/problems/path-with-maximum-gold/
# = = = = = = = = = = = = = =
# Accepted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 3375 ms, faster than 33.39% of Python3 online submissions for Path
# with Maximum Gold.
# Memory Usage: 16.4 MB, less than 94.92% of Python3 online submissions for
# Path with Maximum Gold.
@lbvf50mobile
lbvf50mobile / matrixScore.py
Created May 13, 2024 16:18
Leetcode: 861. Score After Flipping Matrix.
# Leetcode: 861. Score After Flipping Matrix.
# https://leetcode.com/problems/score-after-flipping-matrix/
# = = = = = = = = = = = = = =
# Accepted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 48 ms, faster than 14.66% of Python3 online submissions for Score
# After Flipping Matrix.
# Memory Usage: 16.6 MB, less than 18.53% of Python3 online submissions for
# Score After Flipping Matrix.
@lbvf50mobile
lbvf50mobile / largestLocal.go
Created May 12, 2024 17:10
Leetcode: 2373. Largest Local Values in a Matrix.
// Leetcode: 2373. Largest Local Values in a Matrix.
// https://leetcode.com/problems/largest-local-values-in-a-matrix/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 11 ms, faster than 57.14% of Go online submissions for Largest
// Local Values in a Matrix.
// Memory Usage: 6.3 MB, less than 75.00% of Go online submissions for Largest
// Local Values in a Matrix.
@lbvf50mobile
lbvf50mobile / mincostToHireWorkers.py
Created May 11, 2024 16:44
Leetcode: 857. Minimum Cost to Hire K Workers.
# Leetcode: 857. Minimum Cost to Hire K Workers.
# https://leetcode.com/problems/minimum-cost-to-hire-k-workers/
# = = = = = = = = = = = = = =
# Accepted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 159 ms, faster than 43.32% of Python3 online submissions for
# Minimum Cost to Hire K Workers.
# Memory Usage: 18.9 MB, less than 78.93% of Python3 online submissions for
# Minimum Cost to Hire K Workers.
@lbvf50mobile
lbvf50mobile / kthSmallestPrimeFraction.py
Created May 11, 2024 16:37
Leetcode: 786. K-th Smallest Prime Fraction.
# Leetcode: 786. K-th Smallest Prime Fraction.
# https://leetcode.com/problems/k-th-smallest-prime-fraction/
# = = = = = = = = = = = = = =
# Accepted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 52 ms, faster than 98.30% of Python3 online submissions for K-th
# Smallest Prime Fraction.
# Memory Usage: 16.7 MB, less than 98.98% of Python3 online submissions for
# K-th Smallest Prime Fraction.
@lbvf50mobile
lbvf50mobile / maximumHappinessSum.py
Created May 9, 2024 16:22
Leetcode: 3075. Maximize Happiness of Selected Children.
# Leetcode: 3075. Maximize Happiness of Selected Children.
# https://leetcode.com/problems/maximize-happiness-of-selected-children/
# = = = = = = = = = = = = = =
# Accpeted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 812 ms, faster than 50.69% of Python3 online submissions for
# Maximize Happiness of Selected Children.
# Memory Usage: 42.8 MB, less than 84.50% of Python3 online submissions for
# Maximize Happiness of Selected Children.
@lbvf50mobile
lbvf50mobile / findRelativeRanks.go
Created May 9, 2024 16:17
Leetcode: 506. Relative Ranks.
// Leetcode: 506. Relative Ranks.
// https://leetcode.com/problems/relative-ranks/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 14 ms, faster than 32.00% of Go online submissions for Relative
// Ranks.
// Memory Usage: 6.1 MB, less than 54.00% of Go online submissions for
// Relative Ranks.
@lbvf50mobile
lbvf50mobile / doubleIt.go
Created May 7, 2024 16:01
Leetcode: 2816. Double a Number Represented as a Linked List.
// Leetcode: 2816. Double a Number Represented as a Linked List.
// https://leetcode.com/problems/double-a-number-represented-as-a-linked-list/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 61 ms, faster than 69.23% of Go online submissions for Double a
// Number Represented as a Linked List.
// Memory Usage: 7.8 MB, less than 30.77% of Go online submissions for Double
// a Number Represented as a Linked List.
@lbvf50mobile
lbvf50mobile / removeNodes.go
Last active May 6, 2024 15:32
Leetcode: 2487. Remove Nodes From Linked List.
// Leetcode: 2487. Remove Nodes From Linked List.
// https://leetcode.com/problems/remove-nodes-from-linked-list/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 284 ms, faster than 7.94% of Go online submissions for Remove
// Nodes From Linked List.
// Memory Usage: 13.8 MB, less than 44.44% of Go online submissions for Remove
// Nodes From Linked List.