Skip to content

Instantly share code, notes, and snippets.

View mtimmerm's full-sized avatar

Matt Timmermans mtimmerm

View GitHub Profile
@mtimmerm
mtimmerm / SerialContext.kt
Last active June 8, 2020 03:08
use withSerialContext to run coroutines serially on a multithreaded dispatcher
/*
Copyright 2019 Matthew D.G. Timmermans
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@mtimmerm
mtimmerm / ai_reasoning_challenge_v2.md
Last active January 9, 2025 04:17 — forked from VictorTaelin/ai_reasoning_challenge_v2.md
INVERT A BINARY TREE - $10k AI REASONING CHALLENGE (v2)

VICTOR'S PROBLEM

🌲 Invert a binary tree! 🌲

Except with 3 catches:

  1. It must invert the keys ("bit-reversal permutation")
  2. It must be a dependency-free, pure recursive function
  3. It must have type Bit -> Tree -> Tree (i.e., a direct recursion with max 1 bit state)