Solved


Knight's Tour Checker
Given a matrix a, determine whether or not a legal <http://en.wikipedia.org/wiki/Knight's_tour knight's tour> is present. The kn...

ungefär 2 månader ago

Solved


Word Counting and Indexing
You are given a list of strings, each being a list of words divided by spaces. Break the strings into words, then return a maste...

ungefär 2 månader ago

Solved


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

ungefär 2 månader ago

Solved


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

ungefär 2 månader ago

Solved


Remove the polynomials that have positive real elements of their roots.
The characteristic equation for a dynamic system is a polynomial whose roots indicate its behavior. If any of the roots of the p...

ungefär 2 månader ago

Solved


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

ungefär 2 månader ago

Solved


Find the palindrome
Given the string a, find the longest palindromic sub-string b. So when a = 'xkayakyy'; you should return b = 'kayak';

ungefär 2 månader ago

Solved


Find common elements in matrix rows
Given a matrix, find all elements that exist in every row. For example, given A = 1 2 3 5 9 2 5 9 3 2 5 9 ...

3 månader ago

Solved


Summing Digits within Text
Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

3 månader ago

Solved


Quote Doubler
Given a string s1, find all occurrences of the single quote character and replace them with two occurrences of the single quote ...

3 månader ago

Solved


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

3 månader ago

Solved


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

3 månader ago

Solved


Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...

3 månader ago

Solved


Sum of series IV
What is the sum of the following sequence: Σ(-1)^(k+1) (2k-1)^2 for k=1...n for different n?

4 månader ago

Solved


Sum of series I
What is the sum of the following sequence: Σ(2k-1) for k=1...n for different n?

4 månader ago

Solved


Evened up (or not)
You will be provided with an array or matrix that contains various numbers, in addition to an evening variable, e, set to 1 or 0...

5 månader ago

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

5 månader ago

Solved


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

5 månader ago

Solved


How many digits are there?
Input(s) - any string Output(n) - number of digits within string s

5 månader ago

Solved


Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...

5 månader ago

Solved


A matrix of extroverts
Now that the introverts have had their script, the extroverts spoke up (naturally!) and demanded one as well. You will be given...

5 månader ago

Solved


Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

5 månader ago

Solved


Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

5 månader ago

Solved


subtract central cross
Given an n-by-n square matrix, where n is an odd number, return the matrix without the central row and the central column.

5 månader ago

Solved


Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

5 månader ago

Solved


Given a matrix, swap the 2nd & 3rd columns
If a = [1 2 3 4; 1 2 3 4; 1 2 3 4; 1 2 3 4]; then the result is ans = 1 3 2 4 1 3 2...

6 månader 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...

6 månader ago

Solved


Fix the last element of a cell array
Note: this is lifted directly from <http://www.mathworks.com/matlabcentral/answers/82825-puzzler-for-a-monday Puzzler for a Mond...

6 månader ago

Solved


Convert a Cell Array into an Array
Given a square cell array: x = {'01', '56'; '234', '789'}; return a single character array: y = '0123456789'

6 månader ago

Solved


Natural numbers in string form
Create a cell array of strings containing the first n natural numbers. _Slightly_ harder than it seems like it should be. Ex...

6 månader ago

Load more