Infinite precision division
Develop a function that will divide a very very large integer numerator, supplied to function as a string (e.g., '12233344445555...
5年以上 前
解決済み
How to multiply?
* Imagine you are in 3012 Anno Domini, when everyone must learn how to multiply,
* and competing for the highly prestigious pos...
5年以上 前
解決済み
How to subtract?
*± ± ± ± ± ± ± ± ± ± ±*
* Imagine you need to subtract one...
5年以上 前
解決済み
How to add?
* Imagine you are in 2222 Anno Domini, when everyone must learn how to add,
* and competing for the highly prestigious post of,...
5年以上 前
解決済み
Tic Tac Toe FTW
Given a tic tac toe board:
* 1 represents X
* 0 represents empty.
* -1 represents O
It is X's move. If there is an imme...
Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...
5年以上 前
解決済み
Duplicates
Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...
5年以上 前
解決済み
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Inpu...
5年以上 前
解決済み
Prime factor digits
Consider the following number system. Calculate the prime factorization
for each number n, then represent the prime factors in a...
5年以上 前
解決済み
Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...
De-dupe
Remove all the redundant elements in a vector, but keep the first occurrence of each value in its original location. So if
a =...
5年以上 前
解決済み
Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me
by Matt Simoneau.
Given a vector x, make an indexed pro...
5年以上 前
解決済み
Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...
5年以上 前
解決済み
Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...