Comment

Comment by j-pb

Ah off by one errors are hard:

> 1 ^ 2 ^ ... ^ n ^ A[0] ^ A[1] ^ ... ^ A[n - 1]

should be

> 1 ^ 2 ^ ... ^ n ^ A[0] ^ A[1] ^ ... ^ A[n - 2]

Because a 0 indexed array of length n-1, has n-2 as it's last index. After all, it's missing a value.

parent j-pb 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton