Resuelto


ゼロでない要素が一番多い行を探そう
行列 a が与えられたとき、行列 a の中で一番ゼロの要素が少ない行のインデクス r を返す関数を作成しましょう。このとき、行列 a には一つだけしかこの条件に当てはまる行がないと仮定します。 例: 入力として、行列 a = [ 1 ...

11 meses hace

Resuelto


行列内の素数の平均をとろう
行列が与えられたときに、その行列内の素数の平均を計算する関数を作成しましょう。 例: 入力の行列が in = [ 8 3            5 9 ] のとき、 出力が 4 あるいは (3+5)/2 のようになり...

11 meses hace

Resuelto


ベクトルの値が増加しているかを調べよう
ベクトルの値が増加している場合 (ベクトルの各要素が前の要素よりも大きい場合) には true を、そうでない場合には false を返すようなコードを書いてみましょう。 例: 入力が x = [-3 0 7] のとき、 関数の...

11 meses hace

Resuelto


Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

11 meses hace

Resuelto


Union Jack Matrix
Create a matrix of odd dimensions that has ones on both diagonals and dividing the matrix into 4 quadrants, resembling a square ...

11 meses hace

Resuelto


Vandermonde Matrix
Create the Vandermonde Matrix of the given vector. The matrix consists of columns as powers of the vector, so the first column i...

11 meses hace

Resuelto


Tent matrix
Create an n x n matrix that resembles one kind of tent. The variable n is provided to the function and will be an odd number. As...

11 meses hace

Resuelto


Create a square matrix with given conditions
Create a square matrix, M, which should be populated as follows: M = [ n^2 n * (n-1) n * (n-2) ... n * 2 n * ...

11 meses hace

Resuelto


Form a square matrix from four square sub-matrices
Create a square matrix, y, from 4 square sub-matrices that will be constructed (x1, x2, x3, x4): y = [x1 x2; x3 x4]; ...

11 meses hace

Resuelto


Produce the following matrix
Produce the following matrix x = [2 3 4] y_correct = [1 1/2 1/3; 2 1 1/4; 3 4 1];

11 meses hace

Resuelto


Check if a matrix is a palindrome in all directions
Check if a matrix is a palindrome both vertically and horizontally. You function will return *true* for |[1,2,1]| or |[2,7,2;...

11 meses hace

Resuelto


Digital Neighbourhood
Given a natural number reorder its digits to create another number, closest to the given one. Examples: * 123 gives 132, ...

11 meses hace

Resuelto


Binary Neighbourhood
Given a natural number reorder its binary form to create another number, closest to the given one. Examples: * 1 gives 2, ...

11 meses hace

Resuelto


De-primed
Write a function that will multiply every prime number in the array or matrix by two, leaving all other numbers the same, and re...

11 meses hace

Resuelto


Big numbers, least significant digits
Given two numbers, x and n, return the last d digits of the number that is calculated by x^n. In all cases, d will be the number...

11 meses hace

Resuelto


Consecutive Equation Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on the largest consecutive run of ...

11 meses hace

Resuelto


Equation Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on times that include the four bas...

11 meses hace

Resuelto


Power Times (of the day)
Many times throughout the day can represent mathematical equations. In this problem, we focus on times that represent powers. Fo...

11 meses hace

Resuelto


Bit calculation
Give me the count of numbers from 1 to n having their last two bits as 0. For example function y = ret_count(4) y = x...

11 meses hace

Resuelto


Big numbers, repeated least significant digits
This problem builds off of Problem 3077 Given an integer x which contains d digits, find the value of (minimum) n (n > 1) such ...

11 meses hace

Resuelto


Math with Roman Numerals
Given a function R within (+,-,*,/) and two Roman numerals a & b, compute aRb in Roman numerals.

11 meses hace

Resuelto


Numbers in extended form
Shhhhhhh. Don't tell my daddy, but I'm borrowing his Cody account so all of you very smart people can help me out. I just star...

11 meses hace

Resuelto


Ripping numbers apart!
So you have to "rip" a number apart into individual digits... The end output is a cell. That is if: x = 12345678 o...

11 meses hace

Resuelto


Convert Roman to Arabic Numerals
Based upon what I see on tv and at the movies, the use of Roman numerals indicates something is important or sophisticated (e.g....

11 meses hace

Resuelto


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

11 meses hace

Resuelto


English to Pig Latin Translator
Pig latin is a faux-language based off of English. The rules are as follows (excerpted from the wikipedia entry for Pig Latin): ...

11 meses hace

Resuelto


QWERTY Shift Code Decoder
Decode a string encoded using the QWERTY shift code. QWERTY shift code is where the message was touch typed but with an offse...

11 meses hace

Resuelto


Generate a Parasitic Number
This problem is the next step up from Problem 156. Rather than determining if an input is a parasitic number, you will be asked ...

11 meses hace

Resuelto


Find vampire numbers
A vampire number is a number v that is the product of two numbers x and y such that the following conditions are satisfied: at ...

11 meses hace

Resuelto


Champernowne Constant
The <http://en.wikipedia.org/wiki/Champernowne_constant Champernowne constant> is a real number whose digits in decimal represen...

11 meses hace

Cargar más