解決済み


Cache me Outside
The test suite includes a simple recursive Fibonacci sequence generator, but it's terribly inefficient. One simple method for im...

約6年 前

解決済み


Is this a valid Tic Tac Toe State?
For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...

約6年 前

解決済み


Hexagonal numbers on a spiral matrix
Put hexagonal numbers in a ( m x m ) spiral matrix and return the sum of its diagonal elements. Formula of hexagonal numbers ...

約6年 前

解決済み


An asteroid and a spacecraft
&#128640 Imagine a non-relativistic simple situation. Assume positions p0, p1, p2, and p3 are three dimensional Cartesian ...

約6年 前

解決済み


N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...

約6年 前

解決済み


Digit concentration in Champernowne's constant
Consider the first 50 digits of Champernowne's constant 0.12345678910111213141516171819202122232425262728293... The...

約6年 前

解決済み


"Cody" * 5 == "CodyCodyCodyCodyCody"
*Alice*: What? *"Cody" * 5 == "CodyCodyCodyCodyCody"*? You've gotta be kidding me! *Bob*: No, I am serious! Python supports...

約6年 前

解決済み


Sums of Distinct Powers
You will be given three numbers: base, nstart, and nend. Write a MATLAB script that will compute the sum of a sequence of both ...

約6年 前

解決済み


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

約6年 前

解決済み


Acid and water
&#9878; &#9878; &#9878; &#9878; &#9878; &#9878; &#9878; &#9878; Assume that there is a 100 liter tank. It is initially fi...

約6年 前

解決済み


The 5th Root
Write a function to find the 5th root of a number. It sounds easy, but the typical functions are not allowed (see the test su...

約6年 前

解決済み


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

約6年 前

解決済み


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

約6年 前

解決済み


Target sorting
Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

約6年 前

解決済み


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

約6年 前

解決済み


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

約6年 前

解決済み


The Goldbach Conjecture
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

約6年 前

解決済み


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

約6年 前

解決済み


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

約6年 前

解決済み


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

約6年 前

解決済み


Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...

約6年 前

解決済み


Find relatively common elements in matrix rows
You want to find all elements that exist in greater than 50% of the rows in the matrix. For example, given A = 1 2 3 5 ...

約6年 前

解決済み


Binary numbers
Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

約6年 前

解決済み


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

約6年 前

解決済み


Nearest Numbers
Given a row vector of numbers, find the indices of the two nearest numbers. Examples: [index1 index2] = nearestNumbers([2 5 3...

約6年 前

解決済み


Counting Money
Add the numbers given in the cell array of strings. The strings represent amounts of money using this notation: $99,999.99. E...

約6年 前

解決済み


Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once. Example: Input s ...

約6年 前

解決済み


Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

約6年 前

解決済み


Function Iterator
Given a handle fh to a function which takes a scalar input and returns a scalar output and an integer n >= 1, return a handle f...

約6年 前

解決済み


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

約6年 前

さらに読み込む