Skip to content

Commit 799b72c

Browse files
committed
task3 initial
1 parent ae1026e commit 799b72c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### Taxicab numbers
2+
3+
A `taxicab` number is an integer that can be expressed as the sum of two cubes of positive integers in two different ways: `a^3 + b^3 = c^3 + d^3`.
4+
For example, `1729` is the smallest taxicab number: `9^3 + 10^3 = 1^3 + 12^3`.
5+
Design an algorithm to find all taxicab numbers with `a`, `b`, `c`, and `d` less than `n`.
6+
7+
- Version 1: Use time proportional to `(n^2)*log(n)` and space proportional to `n^2`.
8+
- Version 2: Use time proportional to `(n^2)*log(n)` and space proportional to `n`.

week4/priority-queues/task3/solution.rb

Whitespace-only changes.

0 commit comments

Comments
 (0)