A résolu


Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...

environ 5 ans il y a

A résolu


Fibonacci-Sum of Squares
Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

environ 5 ans il y a

A résolu


How many Fibonacci numbers?
Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

environ 5 ans il y a

A résolu


Fibonacci Decomposition
Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

environ 5 ans il y a

A résolu


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

environ 5 ans il y a

A résolu


Find the next Fibonacci number
In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

environ 5 ans il y a

A résolu


Return the Fibonacci Sequence
Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

environ 5 ans il y a

A résolu


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

environ 5 ans il y a

A résolu


Find the product of a Vector
How would you find the product of the vector [1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0] times 2?; x = [1 : 0.5 : 6]; y ...

environ 5 ans il y a

A résolu


Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.

environ 5 ans il y a

A résolu


Replace NaNs with the number that appears to its left in the row.
Replace NaNs with the number that appears to its left in the row. If there are more than one consecutive NaNs, they should all ...

environ 5 ans il y a

A résolu


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

environ 5 ans il y a

A résolu


Find out total non zero element of matrix
Find out Non zero element of matrix A=magic(5) 17 24 1 8 15 23 5 7 14 16 4 6...

environ 5 ans il y a

A résolu


Number of Even Elements in Fibonacci Sequence
Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

environ 5 ans il y a

A résolu


Project Euler: Problem 16, Sums of Digits of Powers of Two
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^N? Thanks ...

environ 5 ans il y a

A résolu


Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

environ 5 ans il y a

A résolu


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

environ 5 ans il y a

A résolu


Create a two dimensional zero matrix
You have to create a zero matrix of size (mxn) whose inputs are m and n and the elements of your matrix should be zeros. Exam...

environ 5 ans il y a

A résolu


Find the minimal value in N*N Matrix
Suppose that we have N by N matrix, we try to find the minimal value in that matrix. examples: Input A=[1 2 3 5 6;52 58 56 45...

environ 5 ans il y a

A résolu


Find the sum of the largest two elements in a vector
With this one, you have to find the two largest elements in a vector and output the sum of those numbers.

environ 5 ans il y a

A résolu


Replace 0 indices in array with 1's
Take a incoming vector, and replace 0's with ones

environ 5 ans il y a

A résolu


Sum two matrices
Take two incoming matrices, and sum them

environ 5 ans il y a

A résolu


Matrix multiplication
Multiply two incoming matrices via matrix multiplication

environ 5 ans il y a

A résolu


Numbers spiral diagonals (Part 2)
Inspired by Project Euler n°28 and 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the righ...

environ 5 ans il y a

A résolu


Prime Ladders
A <http://en.wikipedia.org/wiki/Word_ladder word ladder> transforms one word to another by means of single-letter mutations. So ...

environ 5 ans il y a

A résolu


PIN code III

environ 5 ans il y a

A résolu


PIN code

environ 5 ans il y a

A résolu


Insert zeros II

environ 5 ans il y a

A résolu


How many digits are there?
Input(s) - any string Output(n) - number of digits within string s

environ 5 ans il y a

A résolu


Swap rows

environ 5 ans il y a

Charger plus