🌲 Invert a binary tree! 🌲
Except with 3 catches:
- It must invert the keys ("bit-reversal permutation")
- It must be a dependency-free, pure recursive function
- It must have type
Bit -> Tree -> Tree
(i.e., a direct recursion with max 1 bit state)
/** | |
* @prompt | |
* 指定されたTypeScriptのファイルから型定義とimportを抽出します | |
* $ deno run -A getDeclaration.ts <target> | |
*/ | |
import ts from "npm:[email protected]"; | |
export function getSourceSummary(filePath: string): string { | |
const compilerOptions: ts.CompilerOptions = { |
#!/bin/bash | |
# Denoのインストール | |
curl -fsSL https://deno.land/x/install/install.sh | sh | |
# .bashrcまたは.zshrcにパスを追加 | |
if [ -n "$ZSH_VERSION" ]; then | |
echo 'export DENO_INSTALL="$HOME/.deno"' >> ~/.zshrc | |
echo 'export PATH="$DENO_INSTALL/bin:$PATH"' >> ~/.zshrc | |
source ~/.zshrc |
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; |
if (import.meta.env.DEV) { | |
const script = document.createElement('script') | |
script.src = 'https://cdn.jsdelivr.net/npm/eruda' | |
// @ts-ignore global eruda | |
script.onload = () => globalThis.eruda.init() | |
document.body.append(script) | |
} |
A::B is a system with 4 tokens: `A#`, `#A`, `B#` and `#B`. | |
An A::B program is a sequence of tokens. Example: | |
B# A# #B #A B# | |
To *compute* a program, we must rewrite neighbor tokens, using the rules: | |
A# #A ... becomes ... nothing | |
A# #B ... becomes ... #B A# |