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

2 months ago

Solved

QWERTY coordinates

Given a lowercase letter or a digit as input, return the row where that letter appears on a <http://en.wikipedia.org/wiki/Keyboa...

2 months ago

Solved

Find the two most distant points

Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

2 months ago

Solved

What is the next step in Conway's Life?

Given a matrix A that represents the state of <http://en.wikipedia.org/wiki/Conway's_Game_of_Life Conway's game of Life> at one ...

2 months ago

Solved

Duplicates

Write a function that accepts a cell array of strings and returns another cell array of strings *with only the duplicates* retai...

2 months ago

Solved

Maximum running product for a string of numbers

Given a string s representing a list of numbers, find the five consecutive numbers that multiply to form the largest number. Spe...

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

2 months ago

Solved

Scrabble Scores

Given a word, determine its score in <http://en.wikipedia.org/wiki/Scrabble Scrabble>. The input string will always be provi...

2 months 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 months ago

Solved

Tic Tac Toe FTW

Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

3 months ago

Solved

Generate N equally spaced intervals between -L and L

Given N and L, return a list of numbers (in ascending order) that divides the interval [-L L] into N equal-length segments. F...

3 months ago

Solved

Generate n equally spaced "intervals" between -x and x (★)

Given n and x, return a list of numbers (in ascending order) that divides the interval [-x x] into n equal-length intervals. ...

3 months ago

Solved

Find nearest prime number less than input number

Find nearest prime number less than input number. For example: if the input number is 125, then the nearest prime number whi...

3 months ago

Solved

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

3 months 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 months ago

Solved

(Linear) Recurrence Equations - Generalised Fibonacci-like sequences

This problem is inspired by problems <http://uk.mathworks.com/matlabcentral/cody/problems/2187-generalized-fibonacci 2187>, <htt...

3 months ago

Solved

Free passes for everyone!

_Simply return the name of the coolest numerical computation software ever_ *Extra reward* (get a _freepass_): Once a mont...

3 months ago

Solved

Pattern matching

Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

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

3 months ago

Solved

The Goldbach Conjecture, Part 2

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

3 months ago

Solved

Find state names that end with the letter A

Given a list of US states, remove all the states that end with the letter A. Example: Input s1 = 'Alabama Montana Nebras...

3 months ago

Solved

Encode Roman Numerals

Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...

3 months ago

Solved

Find the two-word state names

Given a list of states, remove all the states that have two-word names. If s1 = 'Alabama Montana North Carolina Vermont N...

3 months ago

Solved

construct matrix with identical rows

Input a row vector such as x=1:10. Now we need to construct a matrix with L rows,of which every row vector is a copy of x. E...

3 months ago

Solved

Colon operator of two vectors

You are given two vectors of equal length: VecStart, VecEnd Each vector contain a set of integers, where VecEnd(j)>=VecStar...

3 months ago

Solved

Fibonacci Decomposition

Every positive integer has a unique decomposition into nonconsecutive Fibonacci numbers f1+f2+ ... Given a positive integer n, r...

3 months ago

Solved

Return the Fibonacci Sequence

Write a code which returns the Fibonacci Sequence such that the largest value in the sequence is less than the input integer N. ...

3 months ago

Solved

Find the next Fibonacci number

In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

3 months ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

3 months ago

Solved

Find the peak 3n+1 sequence value

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

3 months ago