Skip to content

Instantly share code, notes, and snippets.

View frectonz's full-sized avatar
❄️

Fraol Lemecha frectonz

❄️
View GitHub Profile
@frectonz
frectonz / missingBits.go
Last active January 23, 2023 16:13
From cassido's January 23, 2023 Newsletter
package main
import (
"fmt"
"strconv"
)
func main() {
val1 := missingBits([]int{1, 2, 3, 4, 20, 21, 22, 23})
fmt.Println(val1)
@frectonz
frectonz / maxSubArray.go
Created January 2, 2023 11:06
From cassido's January 2, 2023 Newsletter
package main
import "fmt"
func main() {
res1 := maxSubArray([]int{-4, 2, -5, 1, 2, 3, 6, -5, 1}, 4)
fmt.Println(res1)
res2 := maxSubArray([]int{1, 2, 0, 5}, 2)
fmt.Println(res2)
}
function replaceZeros(input: string): number {
let zeroes = 0;
const res = input
.split("")
.reduce((acc: string[], curr, index, digits) => {
const next = digits[index + 1];
if (curr === "0" && next === "0") {
zeroes++;
import {
Dispatch,
ReactNode,
useContext,
useReducer,
createContext,
} from "react";
export interface StoreProviderProps {
children?: ReactNode;