RSSAmplifier

Blog

Luke's Website

luke-g.comRSS feed ↗10 posts

Latest posts

Longest increasing subsequence in 51 bytes

One joy of code golf is when a complex algorithm reduces to a short magic formula. codeglf.com hosted a challenge to find the shortest Python program to calculate the length of the longest increasing subsequence (LIS). LIS is a classic algorithmic task: given an array of numbers, what is the longest subsequence (not necessarily contiguous) [ ]

The 2025 Google Code Golf Championship, Part 2

Continuing where we left off in the previous article, about one month into the competition, our team was fully formed and busy golfing! Although we had some strong scores on individual tasks (as per the public scores spreadsheet), we were behind other teams on the number of tasks solved. Team ox jam had finished early: [ ]

The 2025 Google Code Golf Championship, Part 1

I was privileged to be a part of the winning team in the NeurIPS 2025 Google Code Golf Championship, which took place August October 2025. The goal of this competition was to solve 400 Python problems in as few bytes as possible ( code golf refers to minimizing the length of programs). The problems consisted of grid-based [ ]

Unicode packing in JavaScript: The 2:1-plus packer

In this article, we'll look at some techniques for how ordinary JavaScript code can be packed into a shorter program using Unicode. We'll analyze 2:1 packing techniques, including some variations I developed that can sometimes do better than 2:1.

Fun numbers and generating functions

Why does 100/9801 equal 0.0102030405...? In this article, we'll create fractions that evaluate to interesting decimal numbers and give a gentle introduction to generating functions.

Packing hex numbers in JavaScript, part 2

This is a follow-up to my previous article about the Golf Horse “SIGBOVIK” problem. With great effort, I managed to save 6 more bytes. In this article, I'll give an in-depth explanation of the additional techniques I used and how I discovered them.

Packing hex numbers in JavaScript

The "SIGBOVIK" problem is the shortest problem in the Golf Horse collection. The goal is to write the shortest JavaScript program that prints out thirteen 64-digit hexadecimal numbers. Despite the apparent simplicity of this challenge, there's still a surprising amount of depth to it!

Strengthening AM-GM with determinants

In this article, we'll take a look at an interesting connection between the 3-variable AM-GM inequality and the determinant of a particular matrix. We'll see this connection also reveals when AM-GM holds for negative numbers, and it can be used to produce stronger versions of the inequality.

Wordle golf challenge: wrap-up and retrospective

This is the sixth article in the series for Golf Horse: Wordle. I'll go through some ideas for future improvements, and ideas that didn't make the cut.

Compressing JavaScript with JavaScript

This is the fifth article in the series for Golf Horse: Wordle. We'll build a very simple decompressor for JavaScript code to save a few bytes.