Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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];

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Solved


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

12 months ago

Load more