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年以上 前
解決済み
Kaprekar Steps
6174 is the <http://en.wikipedia.org/wiki/6174_%28number%29 Kaprekar constant>. All natural numbers less than 10,000 (except som...
3年以上 前
解決済み
Alphabetize by last name
Given a list of names in a cell array, sort the list by the last name. So if
list = {'Barney Google','Snuffy Smith','Dagwood ...
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...
Encode Roman Numerals
Create a function taking a non-negative integer as its parameter and returning a string containing the Roman Numeral representat...
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
3年以上 前
解決済み
QWERTY coordinates
Given a lowercase letter or a digit as input, return the row where that letter appears on a standard U.S. QWERTY keyboard and it...
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年以上 前
解決済み
Prime factor digits
Consider the following number system. Calculate the prime factorization for each number n, then represent the prime factors in a...
Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the numbers. Otherwise return false.
Example...
3年以上 前
解決済み
Given two arrays, find the maximum overlap
Given two (integer) arrays s1 and s2, create a new array s3 which is as short as possible and contains both arrays.
#1
s1 = [...
3年以上 前
解決済み
Interpolator
You have a two vectors, a and b. They are monotonic and the same length. Given a value, va, where va is between a(1) and a(end...
3年以上 前
解決済み
Counting Sequence
Given a vector x, find the "counting sequence" y.
A counting sequence is formed by "counting" the entries in a given sequence...
3年以上 前
解決済み
matrix zigzag
Unfold a 2-D matrix to a 1-D array in zig-zag order, e.g., for matrix
[ 1 2 3 ;
4 5 6 ;
7 8 9 ]
the resulting 1-...
3年以上 前
解決済み
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:...