Questions tagged [restricted-memory]

For challenges with a restriction placed on the amount of memory that can be allocated. This can be through direct limits (e.g. 64 bytes) or through big-O-notation (e.g. O(n log(n))).

Filter by
Sorted by
Tagged with
6 votes
3 answers
381 views

Fastest unique finder

Given 4096 16-bit integers, only four of which are unique and others appeared twice (so 2050 different integers exist). Find the four uniques. To time precisely and limit RAM usage, your program will ...
user avatar
  • 12.7k
4 votes
3 answers
267 views

unRSA: solve the private key

Given positive integer n and e, knowing that e<n and that ...
user avatar
  • 12.7k
13 votes
1 answer
238 views

Efficiently generate all vector partitions

A vector partition is splitting a vector up a series of vectors such that their sum is the original. Here are a couple partitions: ...
user avatar
  • 38.6k
83 votes
201 answers
15k views

Count up forever

Write a program that counts up forever, starting from one. Rules: Your program must log to STDOUT or an acceptable alternative, if ...
user avatar
  • 2,405
8 votes
2 answers
521 views

Filter a large file in small memory

The challenge is a follow-up to Filter a large file quickly which had two submissions where were as fast as wc! This time the difficulty is that RAM is severely restricted which means that new ...
user avatar
14 votes
5 answers
731 views

Print a specific value in this generated binary matrix

Suppose we define an infinite matrix M, on N^2 -> {0, 1} (where N starts from ...
user avatar
  • 33.7k
3 votes
13 answers
806 views

Finding duplicate balls in a basket? [closed]

A basket is full with \$n\$ colored balls. For each color except one, there are at least 2 balls with that color. Find the color which only has one ball. in \$O(n)\$ space complexity. What if each ...
user avatar
42 votes
9 answers
6k views

Text compression and decompression — "Nevermore."

With the recent discussion about the use of compression tools in code golf, I thought it would be a nice challenge to write your own text compressor and decompressor. Challenge: Write two programs: ...
user avatar
71 votes
23 answers
12k views

Fastest way to sort a big array of Gaussian-distributed data

Following the interest in this question, I thought it would be interesting to make answers a bit more objective and quantitative by proposing a contest. The idea is simple: I have generated a binary ...
user avatar