Relative ratio of "1" in binary number
Input(n) is positive integer number
Output(r) is (number of "1" in binary input) / (number of bits).
Example:
* n=0; r=...
Binary code (array)
Write a function which calculates the binary code of a number 'n' and gives the result as an array(vector).
Example:
Inpu...
約2年 前
解決済み
Bit Reversal
Given an unsigned integer _x_, convert it to binary with _n_ bits, reverse the order of the bits, and convert it back to an inte...
約2年 前
解決済み
Finding sum of even numbers in a vector.
Find the sum of all the even numbers present in the input vector x.
Examples:
Input x = [1 2 3 4]
Output y is 6
Input...
More Simple String Concatenation
Take the first string input, reverse the order of the string from the end to beginning (i.e. apple becomes elppa), add a space a...
約2年 前
解決済み
Find the mean of two vectors
Take two vectors, and output the mean of them (bonus if you don't use the in-built mean function)
約2年 前
解決済み
Simple String Concatenation
This is a simple problem involving taking two incoming strings, and outputting the concatenated string with a space separating t...
Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...
約2年 前
解決済み
Get all prime factors
List the prime factors for the input number, in decreasing order. List each factor. If the prime factor occurs twice, list it as...
約2年 前
解決済み
Check if equal
Return true if all the elements of an nD array are equal, false otherwise.
約2年 前
解決済み
Solving Quadratic Equations (Version 1)
Quadratic equations have the form: ax^2 + bx + c = 0. Example: x^2 + 3x + 2 = 0, where a = 1, b = 3, and c = 2. The equation has...
約2年 前
解決済み
Negative matrix
Change the sign of all elements in given matrix.