Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Challenges related to elementary arithmetic.
10
votes
3
answers
502
views
Verify the birth number
A Norwegian Birth Number consists of 11 digits, composed the following way:
DDMMYYiiikk
DD is the day (from 01-31)
MM is the month (from 01-12)
YY is the year (from 00-99). It's not differentiated …
13
votes
7
answers
612
views
Find the optimal sliding door width
Sliding doors have varying prices based on the width of the doors. The different prices are as follows:
60 - 80 cm: ¤150
81 - 100 cm: ¤200
101 - 120 cm: ¤220
When buying a closet you would obvi …
9
votes
2
answers
333
views
Solve a mathematical expression from alternating sides
Create a program that solves a mathematical expression using the elements from alternating sides of the expression. The way it’s done is, instead of reading from left to right, you read the first char …
22
votes
14
answers
2k
views
Calculate the bounded cumulative sum of a vector
The cumulative sum of a vector is calculated by simply taking the sum of all previous elements. For instance:
vec = [1 1 1 -1 -1 -1 -1 -1 1 1 1 1 -1]
cum_vec = [1 2 3 2 1 0 -1 -2 -1 0 …
21
votes
11
answers
845
views
Sort a concatenated sequence
Consider a sequence based on recurrence relations, f(n) = f(n-1)+f(n-2), starting with f(1) = x1, f(2) = x2. For x1 = 2, x2 = 1, the sequence begins like this:
2 1 3 4 7 11 18 29 47 76 123 …
23
votes
5
answers
1k
views
Write a Morse Calculator
Write a program or function that takes a mathematical expression in Morse code as input, and returns the solution in Morse code.
Valid operations are plus: + and minus: _ (underscore). You can assume …
13
votes
6
answers
538
views
The unique multiplication spiral
This one is inspired by Calvin's Hobbies recent multiplication table challenge.
Write a function or program that takes an integer N as input and prints or returns a N-by-N unique multiplication spira …
18
votes
12
answers
2k
views
Calculate the volume of an object
You can determine the volume of objects based on a given set of dimensions:
The volume of a sphere can be determined using a single number, the radius (r)
The volume of a cylinder can be determined …
9
votes
6
answers
1k
views
Calculate the Kronecker sum of two matrices
In the examples below, A and B will be 2-by-2 matrices, and the matrices are one-indexed.
A Kronecker product has the following properties:
A⊗B = A(1,1)*B A(1,2)*B
A(2,1)*B A(2,2)*B
…
29
votes
6
answers
4k
views
1+1 = 10, 1+2 = 3
Write a function or program than can do simple arithmetic (addition, subtraction, multiplication and division) in both base 10 and base 2. …
32
votes
21
answers
3k
views
How much present did you get for Christmas?
Yes, how much, not how many...
As we all know, a large present is far better than a small one. Therefore, the value of the presents should always be measured in total volume, not number of presents, …
38
votes
14
answers
6k
views
The sum is always 15
Write a program or function that takes an array of non-negative integers as input and outputs a set of vectors/arrays with the elements of the input array in order, split so that each vector sums up t …
19
votes
2
answers
882
views
Dames, do some math!
The order of operations, PEMDAS, is a basic rule in mathematics telling us which order operations should be performed:
"Parentheses, Exponents, Multiplication and Division, and Addition and Subtracti …