Skip to content

Instantly share code, notes, and snippets.

View leogsouza's full-sized avatar
🎯
Foca no trabalho

Leonardo Souza leogsouza

🎯
Foca no trabalho
  • São Paulo
View GitHub Profile
@leogsouza
leogsouza / round_function.go
Created September 19, 2017 23:17
Go doesn't provide a round function
package main
import "math"
func round(f float64) int {
if math.Abs(f) < 0.5 {
return 0
}
return int(f + math.Copysign(0.5, f))
}
@leogsouza
leogsouza / 01_two_sum_naive.go
Last active March 23, 2021 14:11
LeetCode Problem 1 - Two Sum - Naive solution
package main
func twoSum(nums []int, target int) []int {
for i := 0; i < len(nums); i++ {
for j := 1; j < len(nums); j++ {
if nums[j] == target - nums[i] {
return []int{i, j}
}
}
}
@leogsouza
leogsouza / keybase.md
Last active March 10, 2022 15:55
Keybase proof

Keybase proof

I hereby claim:

  • I am leogsouza on github.
  • I am leogsouza (https://keybase.io/leogsouza) on keybase.
  • I have a public key ASDKdXE7emHpAiW1Wrx9fCnncnDXuyQAHabBgfkULGJQHwo

To claim this, I am signing this object:

@leogsouza
leogsouza / links.txt
Created November 5, 2022 14:40 — forked from opsxcq/links.txt
Download Brazil Election data
Download with
`for ll in $(cat links.txt); do wget --user-agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" $ll & done;`
@leogsouza
leogsouza / grokking_to_leetcode.md
Created May 30, 2023 18:04 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window