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. ...
約4年 前
解決済み
Longest run of consecutive numbers
Given a vector a, find the number(s) that is/are repeated consecutively most often. For example, if you have
a = [1 2 2 2 1 ...
約4年 前
解決済み
Find out sum and carry of Binary adder
Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition.
Examples
Previo...
Create an index-powered vector
Given a input vector x, return y as index-powered vector as shown below.
Example
x = [2 3 6 9]
then y should be
[...
約4年 前
解決済み
Sum of the Matrix Elements
Add up all the elements in a NxM matrix where N signifies the number of the rows and M signifies the number of the columns.
E...
約4年 前
解決済み
Find out magnitude of vector
Find out magnitude of vector.
Say x=[1 2 3], then answer must sqrt(1^2+2^2+3^2)
Please don't use sum function.
If you l...
Check that number is whole number
Check that number is whole number Say x=15, then answer is 1. x=15.2 , then answer is 0. http://en.wikipedia.org/wiki/Whole_numb...
約4年 前
解決済み
Divide by 4
Given the variable x as your input, divide it by 4 and put the result in y.
約4年 前
解決済み
Max of a Vector
Write a function to return the max of a vector
約4年 前
解決済み
Compute Fibonacci Number
Compute the _n_-th Fibonacci Number
f(0) = 0,
f(1) = 1,
f(2) = 1,
f(3) = 2, ...
f(42) = 267914296
約4年 前
解決済み
Check if equal
Return true if all the elements of an nD array are equal, false otherwise.
約4年 前
解決済み
Divide by 4
Given the variable x as your input, divide it by four and put the result in y.
約4年 前
解決済み
Square a Number
Given an input x, return y, which is equal to the square of x.