해결됨

Mandelbrot Numbers

The <http://en.wikipedia.org/wiki/Mandelbrot_set Mandelbrot Set> is built around a simple iterative equation. z(1) = c z...

약 1달 전

해결됨

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

약 1달 전

해결됨

DNA N-Gram Distribution

Given a string s and a number n, find the most frequently occurring n-gram in the string, where the n-grams can begin at any poi...

약 1달 전

해결됨

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

약 1달 전

해결됨

Longest Divisor Run

Given the vector a, find the longest run of consecutive numbers that can be evenly divided by the same number d where d > 1. ...

약 1달 전

해결됨

Connect Four Win Checker

<http://en.wikipedia.org/wiki/Connect_Four Connect Four> is a game where you try to get four pieces in a row. For this problem, ...

약 1달 전

해결됨

Calculate the Levenshtein distance between two strings

This problem description is lifted from <http://en.wikipedia.org/wiki/Levenshtein_distance>. The Levenshtein distance betwee...

약 1달 전

해결됨

Given two strings, find the maximum overlap

Given two strings s1 and s2, create a new string s3 which is as short as possible and contains both strings. If s1 = [1 2...

약 1달 전

해결됨

Find the sum of all the numbers of the input vector

Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

약 1달 전

해결됨

Make the vector [1 2 3 4 5 6 7 8 9 10]

In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

약 1달 전

해결됨

Times 2 - START HERE

Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

약 1달 전

해결됨

Indexed Probability Table

This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

4달 전

해결됨

Roll the Dice!

*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

4달 전

해결됨

Number of 1s in a binary string

Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

4달 전

해결됨

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

4달 전

해결됨

Make a checkerboard matrix

Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...

4달 전

해결됨

Elapsed Time

Given two date strings d1 and d2 of the form yyyy/mm/dd HH:MM:SS (assume hours HH is in 24 hour mode), determine how much time, ...

4달 전

해결됨

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

4달 전

해결됨

The Goldbach Conjecture

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

4달 전

해결됨

Pangrams!

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

4달 전

해결됨

Return the largest number that is adjacent to a zero

This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...

4달 전

해결됨

Quote Doubler

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

4달 전

해결됨

Given a 4x4 matrix, swap the two middle 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...

4달 전

해결됨

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

4달 전

해결됨

Vector creation

Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

4달 전