Skip to content

Instantly share code, notes, and snippets.

@lbvf50mobile
lbvf50mobile / leftmostBuildingQueries.go
Created December 31, 2024 08:53
Leetcode: 2940. Find Building Where Alice and Bob Can Meet
// Leetcode: 2940. Find Building Where Alice and Bob Can Meet
// https://leetcode.com/problems/find-building-where-alice-and-bob-can-meet/editorial/?envType=daily-question&envId=2024-12-22
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// 65 ms Beats 53.13%
// 2024.12.22 Daily Challenge.
// 2024.12.31 implemented.
// Translation of the Leetcode solution from Pyhon to Golang.
@lbvf50mobile
lbvf50mobile / maxKDivisibleComponents.go
Created December 21, 2024 21:21
Leetcode: 2872. Maximum Number of K-Divisible Components
// Leetcode: 2872. Maximum Number of K-Divisible Components
// https://leetcode.com/problems/maximum-number-of-k-divisible-components/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 43 ms, faster than 11.11% of Go online submissions for Maximum
// Number of K-Divisible Components.
// Memory Usage: 23.7 MB, less than 22.22% of Go online submissions for
// Maximum Number of K-Divisible Components.
@lbvf50mobile
lbvf50mobile / reverseOddLevels.go
Created December 20, 2024 20:15
Leetcode: 2415. Reverse Odd Levels of Binary Tree
// Leetcode: 2415. Reverse Odd Levels of Binary Tree
// https://leetcode.com/problems/reverse-odd-levels-of-binary-tree/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 63 ms, faster than 6.67% of Go online submissions for Reverse Odd
// Levels of Binary Tree.
// Memory Usage: 10.7 MB, less than 6.67% of Go online submissions for Reverse
// Odd Levels of Binary Tree.
@lbvf50mobile
lbvf50mobile / maxChunksToSorted.go
Created December 19, 2024 21:17
Leetcode: 769. Max Chunks To Make Sorted
// Leetcode: 769. Max Chunks To Make Sorted
// https://leetcode.com/problems/max-chunks-to-make-sorted/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 0 ms, faster than 100.00% of Go online submissions for Max Chunks
// To Make Sorted.
// Memory Usage: 3.9 MB, less than 6.25% of Go online submissions for Max
// Chunks To Make Sorted.
@lbvf50mobile
lbvf50mobile / finalPrices.go
Created December 18, 2024 21:51
Leetcode: 1475. Final Prices With a Special Discount in a Shop
// Leetcode: 1475. Final Prices With a Special Discount in a Shop
// https://leetcode.com/problems/final-prices-with-a-special-discount-in-a-shop/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 0 ms, faster than 100.00% of Go online submissions for Final
// Prices With a Special Discount in a Shop.
// Memory Usage: 4.7 MB, less than 24.24% of Go online submissions for Final
// Prices With a Special Discount in a Shop.
@lbvf50mobile
lbvf50mobile / repeatLimitedString.go
Created December 17, 2024 17:53
Leetcode: 2182. Construct String With Repeat Limit
// Leetcode: 2182. Construct String With Repeat Limit
// https://leetcode.com/problems/construct-string-with-repeat-limit/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 73 ms, faster than 22.22% of Go online submissions for Construct
// String With Repeat Limit.
// Memory Usage: 9.1 MB, less than 60.00% of Go online submissions for
// Construct String With Repeat Limit.
@lbvf50mobile
lbvf50mobile / getFinalState.go
Created December 16, 2024 16:50
Leetcode: 3264. Final Array State After K Multiplication Operations I
// Leetcode: 3264. Final Array State After K Multiplication Operations I
// https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 0 ms, faster than 100.00% of Go online submissions for Final Array
// State After K Multiplication Operations I.
// Memory Usage: 6.3 MB, less than 12.07% of Go online submissions for Final
// Array State After K Multiplication Operations I.
@lbvf50mobile
lbvf50mobile / maxAverageRatio.go
Last active December 15, 2024 21:16
Leetcode: 1792. Maximum Average Pass Ratio
// Leetcode: 1792. Maximum Average Pass Ratio
// https://leetcode.com/problems/maximum-average-pass-ratio/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 764 ms, faster than 50.00% of Go online submissions for Maximum
// Average Pass Ratio.
// Memory Usage: 21.2 MB, less than 100.00% of Go online submissions for
// Maximum Average Pass Ratio.
@lbvf50mobile
lbvf50mobile / continuous_subarrays.rb
Created December 14, 2024 21:17
Leetcode: 2762. Continuous Subarrays
# Leetcode: 2762. Continuous Subarrays
# https://leetcode.com/problems/continuous-subarrays/
# = = = = = = = = = = = = = =
# Accepted.
# Thanks God, Jesus Christ!
# = = = = = = = = = = = = = =
# Runtime: 1216 ms, faster than 100.00% of Ruby online submissions for
# Continuous Subarrays.
# Memory Usage: 218.6 MB, less than 100.00% of Ruby online submissions for
# Continuous Subarrays.
@lbvf50mobile
lbvf50mobile / findScore.go
Created December 13, 2024 21:46
Leetcode: 2593. Find Score of an Array After Marking All Elements
// Leetcode: 2593. Find Score of an Array After Marking All Elements
// https://leetcode.com/problems/find-score-of-an-array-after-marking-all-elements/
// = = = = = = = = = = = = = =
// Accepted.
// Thanks God, Jesus Christ!
// = = = = = = = = = = = = = =
// Runtime: 195 ms, faster than 45.45% of Go online submissions for Find Score
// of an Array After Marking All Elements.
// Memory Usage: 12.3 MB, less than 90.91% of Go online submissions for Find
// Score of an Array After Marking All Elements.