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
0 votes
5 answers

Mirror a String in Place

Write a program that takes a string as input and modifies it by reversing the string in its place by mirroring the position. The first position goes to last, second to second last and so it goes on. ...
Aitzaz Imtiaz's user avatar
7 votes
3 answers

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 ...
l4m2's user avatar
  • 20.4k
4 votes
3 answers

unRSA: solve the private key

Given positive integer n and e, knowing that e<n and that ...
l4m2's user avatar
  • 20.4k
14 votes
7 answers

Finding the smallest sets

Consider three sets A, B and C each containing n ...
user avatar
13 votes
1 answer

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: ...
orlp's user avatar
  • 39k
87 votes
220 answers

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 ...
vrwim's user avatar
  • 2,501
8 votes
2 answers

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

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 ...
Joe Z.'s user avatar
  • 34.7k
3 votes
13 answers

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 ...
samairtimer's user avatar
43 votes
9 answers

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: ...
Ilmari Karonen's user avatar
71 votes
23 answers

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 ...
static_rtti's user avatar