Skip to content

Instantly share code, notes, and snippets.

View harismh's full-sized avatar

Haris Muhammad harismh

View GitHub Profile
@harismh
harismh / advent-of-code-day-1-part-2.js
Last active January 7, 2022 19:57
Advent of Code Day 1 Solution
// helpers
const sum = (...nums) => nums.reduce((sum, num) => (sum += num) && sum, 0);
const createWindow = size => new Array(size).fill(null);
const insertAndCopy = (val, idx, arr) =>
arr
.slice(0, idx)
.concat([val])
.concat(arr.slice(idx + 1));
// provided data
// @flow
import React from "react";
import * as WebBrowser from "expo-web-browser";
import Constants from "expo-constants";
import {
makeRedirectUri,
useAuthRequest,
useAutoDiscovery
} from "expo-auth-session";
import {