This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @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 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns tic-tac-toe-magic-squares | |
(:require [clojure.math.combinatorics :refer [combinations]])) | |
(defn magic-square-n [magic-square] | |
(int (Math/sqrt (count magic-square)))) | |
(defn range-n2 [n] | |
(range 1 (+ 1 (* n n)))) | |
(defn magic-constant [n] |