Gelöst


Make a simplified barcode
Given an integer to encode, make a barcode using the following encoding scheme: * The bar code is made from the binary versio...

etwa 14 Jahre vor

Gelöst


The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into considera...

etwa 14 Jahre vor

Gelöst


Retirement savings
At the start of what year will you have reached or exceeded a savings goal? Parameters (all are constant scalars given in a s...

etwa 14 Jahre vor

Gelöst


Recurrence relation
A recurrence relation is given by P(1) := 1 P(n+1) := exp(1) - (n+1)*P(n) Write a function that, given an integer |...

etwa 14 Jahre vor

Gelöst


More luck than brains
Give a random function that guess and return numbers from 1 to 6 exactly like the test suite .

etwa 14 Jahre vor

Gelöst


"Look and say" sequence
What's the next number in this sequence? * [0] * [1 0] * [1 1 1 0] * [3 1 1 0] * [1 3 2 1 1 0] This a variant on the w...

etwa 14 Jahre vor

Gelöst


Reduce - Map-Reduce
Write reduce function, that takes arguments and constantly folds results into next call argument, finally returning a value; ...

etwa 14 Jahre vor

Gelöst


Repopulate the City
For any population p of positive integers between pmin and pmax, we can calculate histogram count n for a list of evenly dividin...

etwa 14 Jahre vor

Gelöst


Greed is good - Simple partition P[n].
Find a simple partition P[n]. E.g. P[10] = 4 + 3 + 2 + 1. # There are many solutions, compute just one set. # Don't repeat ...

etwa 14 Jahre vor

Gelöst


Create a patchwork matrix
This function will assemble a large matrix out of a number of smaller ones m1, m2, etc., according to a pattern P. If P is 3x5,...

etwa 14 Jahre vor

Gelöst


Matrix indexing with two vectors of indices
Given a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).

etwa 14 Jahre vor

Gelöst


All Humans are Created Equal - Pareto Equality
One way or the other two sets of identical types can come out ahead of the other by idea of Pareto equality. Pareto equality b...

etwa 14 Jahre vor

Gelöst


middleAsColumn: Return all but first and last element as a column vector
Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

etwa 14 Jahre vor

Gelöst


Implement a counter
Write a function that returns a function that counts the number of times it is invoked. Example: >> h = counter; >> h() ...

etwa 14 Jahre vor

Gelöst


Function composition - harder
Write a function that accepts an arbitrary number of function handles f_1, f_2, ..., f_n and returns the composition h. That is,...

etwa 14 Jahre vor

Gelöst


Function composition
Write a function that accepts two function handles f and g and returns the composition h. That is, h = (f o g)(x) = f(g(x)) ...

etwa 14 Jahre vor

Gelöst


Spiral In
Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

etwa 14 Jahre vor

Gelöst


Return elements unique to either input
Given two numeric inputs a and b, return a row vector that contains the numbers found in only a or only b, but not both. For ex...

etwa 14 Jahre vor

Gelöst


Sort numbers by outside digits
Sort the array so that they are sorted as if their value was a 5 digit number made from the first three and last two digits of t...

etwa 14 Jahre vor

Gelöst


Encoding Google Maps Polylines
This problem is based on the Google Polyline Encoder algorithm. This is how Google Maps encodes a line for display on a map. You...

etwa 14 Jahre vor

Gelöst


Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

etwa 14 Jahre vor

Gelöst


Boolean algebra
Your contractor from Elbonia has sent you the prototype of the new logical unit. It turns out that the only logical relation it ...

etwa 14 Jahre vor

Gelöst


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

etwa 14 Jahre vor

Gelöst


Transposition as a CIPHER
This all about transcripting a text message. If the input string is: *s1 = 'My name is Sourav Mondal'*, then the output is: *s2...

etwa 14 Jahre vor

Gelöst


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,...

etwa 14 Jahre vor

Gelöst


Find the jerk
No, it's not the author of this problem... Jerk is the rate of change in acceleration over time of an object. So, if given t...

etwa 14 Jahre vor

Gelöst


Set defaults
Write a function that computes the volume of a cube. The function should be able to accept three inputs: the length, width, and...

etwa 14 Jahre vor

Gelöst


Find best domino orientation
Given a list of pairs, find the orientation they should be placed in a line, such that the sum of the absolute values of the dif...

etwa 14 Jahre vor

Gelöst


Choose the best fitting dominoes
You will be given a cell array of nx2 matrices. Choose one row from each matrix. These are the ordered pairs that will be plac...

etwa 14 Jahre vor

Gelöst


Find best placement for ordered dominoes (harder)
Given a list of ordered pairs, find the order they should be placed in a line, such that the sum of the absolute values of the d...

etwa 14 Jahre vor

Mehr laden