Gelöst


Sequence Vectorization - I
Given a Natural number N, return the sequence - [1 1 2 1 2 3 1 2 3 4 ... 1 2 3 ... N-3 N-2 N-1 N] i.e. the horizontal concatenat...

mehr als ein Jahr vor

Gelöst


A sequence of Ones
You are given number(s) with all digits - 1. Your answer will depend on the count of 1 in the given number, for example - x1...

mehr als ein Jahr vor

Gelöst


Local Extrema
Given a 2D (m,n>1) matrix, replace an element if it is not a local extrema (minima/maxima), with 0 (zero). The comparison crite...

mehr als ein Jahr vor

Gelöst


French Conundrum
The French army is trapped, sorrounded in backwards direction (South and West directions) by enemy traps and ambushes. You are n...

mehr als ein Jahr vor

Gelöst


Sub-Diagonal Sum
Given a (m x n) matrix and a value r {1,-1}, change every element to the sum of the diagonal led by the element. r=1 > regular ...

mehr als ein Jahr vor

Gelöst


Cubic Integer Constrained Solution
Find an integral non-trivial solution (x,y,z ~=0) (x=0 or y=0 or z=0 are trivial) for the cubic equation 987,654,321x + 123,45...

mehr als ein Jahr vor

Gelöst


Construct a string from letters and counts
Given two input arrays like this: [5,3,1] ['a','b','c'] Output a string that contains each letter the specified num...

mehr als ein Jahr vor

Gelöst


Polybius Square
Given a string, calculate the coordinates. Input will be always in lowercase. If string is a sentence then use 0 (zero) to indic...

mehr als ein Jahr vor

Gelöst


Filter values in a vector
Cody often benefits from a functional style of programming. For example, your score is often better when you compose multiple fu...

mehr als ein Jahr vor

Gelöst


Choose group with people
How many ways can you choose n groups of n people from n^2 people, assuming the groups are distinct? The number of people is gi...

mehr als ein Jahr vor

Gelöst


How many ways to write a number
Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but d...

mehr als ein Jahr vor

Gelöst


Rearrange string
Input is a given string. Output is the number of ways to rearrange the string.

mehr als ein Jahr vor

Gelöst


Permutation
How many different words can be formed using all the letters(together) from a given input word? Input is a string.

mehr als ein Jahr vor

Gelöst


Divisible by 8
Pursuant to the <http://www.mathworks.com/matlabcentral/cody/problems/42404-divisible-by-2 first problem> in this series, this o...

mehr als ein Jahr vor

Gelöst


Divisible by 16
Write a function to determine if a number is divisible by 16. This can be done by a few different methods. Here are two: # If...

mehr als ein Jahr vor

Gelöst


Vector push
Append an element |x| to the end of the vector |v| and return both the extended vector and the new number of its elements. |x| c...

mehr als ein Jahr vor

Gelöst


A Simple Tide Gauge with MATLAB
*&#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767 &#8767* You are standing in a few inches of sea water on a beach. You a...

mehr als ein Jahr vor

Gelöst


Inscribed Pentagon?
Your function will be provided with the five vertices of a pentagon (p) as well as the center point (cp) and radius (r) of a cir...

mehr als ein Jahr vor

Gelöst


Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
How would you split 5 loaves of bread among 8 people in all fairness? Get a hint from the Pharaohs. 5/8 = 4/8 + 1/8 , i.e. each ...

mehr als ein Jahr vor

Gelöst


Hilbert numbers
Given a positive integer, n, return h as follows: 1. If n is not a <https://en.wikipedia.org/wiki/Hilbert_number Hilbert numb...

mehr als ein Jahr vor

Gelöst


Number construction I
Given a positive integer, n, return a, b, c and d, such that 1. n = a*sqrt(b)+c*sqrt(d) 2. a, b, c and d are all positive ...

mehr als ein Jahr vor

Gelöst


struct2values()
Convert a struct object into a column vector. You can assume that the struct elements are scalars Example: a = struct();...

mehr als ein Jahr vor

Gelöst


List the cuban primes
The number 61 is a cuban prime because it is prime and the difference two cubes, 64 and 125. Write a function to list the cuba...

mehr als ein Jahr vor

Gelöst


Determine whether a number is a Blum integer
A Blum integer is a semiprime—that is, the product of two distinct primes—whose factors have the form for some integer . The nu...

mehr als ein Jahr vor

Gelöst


Only once: cleaning up your columns
We have a logical array (with ones and zeroes). It is simple: after processing every column may only contain a single true value...

mehr als ein Jahr vor

Gelöst


Create an arrow matrix
An arrow matrix is a square matrix that contains ones on the diagonal, the last column, and last row. ...

mehr als ein Jahr vor

Gelöst


Draw a X
Given an input , create a square matrix of zeros with an X of ones. Ex. n = 3 drawX(3) [ 1 0 1 0 1 0 1 0 1 ] ...

mehr als ein Jahr vor

Gelöst


What day is it?
Tell me what day is it. Return the full name of the day of the week as a string. e.g. It's June 12th 2014, so your function s...

mehr als ein Jahr vor

Gelöst


Find my secret function IV
We use the same secret function used on the past "Find my secret function ..." x=23 -------->> y=3 X=1000 ------->> 163

mehr als ein Jahr vor

Gelöst


Factorial: Unlimited Size : java.math
This challenge is an application of java.math that allows unlimited precision calculations. The primary reference sites are <ht...

mehr als ein Jahr vor

Mehr laden