Skip to content

Instantly share code, notes, and snippets.

View umohsamuel's full-sized avatar
🛳️
Shipping

Umoh Samuel umohsamuel

🛳️
Shipping
View GitHub Profile
@umohsamuel
umohsamuel / main.go
Created May 28, 2026 00:32
LeetCode 118: Pascal's Triangle (Golang)
func generate(numRows int) [][]int {
output := make([][]int, numRows)
if numRows >= 1 {
output[0] = []int{1}
}
if numRows >= 2 {
output[1] = []int{1, 1}
}
@umohsamuel
umohsamuel / main.go
Created May 27, 2026 23:45
LeetCode 746: Min Cost Climbing Stairs (Golang)
func min(a,b int) int {
if a < b {
return a
}
return b
}
func minCostClimbingStairs(cost []int) int {
var first, second int
@umohsamuel
umohsamuel / main.go
Created May 27, 2026 23:43
LeetCode 70: Climbing Stairs (Golang)
package main
func climbStairs(n int) int {
result := 0
firstPrev, secondPrev := 0, 0
for i := 1; i <= n; i++ {
if i == 1 {
result = 1