解決済み


The Tower of Hanoi
In the <http://en.wikipedia.org/wiki/Tower_of_Hanoi Tower of Hanoi problem> with 3 rods (1, 2 & 3), the goal is to move a tower ...

12年弱 前

解決済み


Pi Estimate 2
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation2.pdf>

12年弱 前

解決済み


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

12年弱 前

解決済み


Implement a ROT13 cipher
Replace each character in string s1 with the character that is shifted 13 positions from it (wrap back to the beginning if neces...

12年弱 前

解決済み


Find the biggest empty box
You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

12年弱 前

解決済み


Pi Estimate 1
Estimate Pi as described in the following link: <http://www.people.virginia.edu/~teh1m/cody/Pi_estimation1.pdf>

12年弱 前

解決済み


Find matching parenthesis
One of the most indispensable things about a great text editor for programming is the ability to quickly jump between matching p...

12年弱 前

解決済み


Cody Matlab Version
What is the current Cody Matlab Release? *Output:* string *Examples:* '(R2012a)' or 'R2012a' Hint: We have mo...

12年弱 前

解決済み


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

12年弱 前

解決済み


Create incremental spiral WITHOUT USING EVAL or FEVAL
Constructions that use feval or eval are used to cheat with cody. This test-suite tries to avoid that trick. The goal of this...

12年弱 前

解決済み


"mirror" matrix
Create n x 2n "mirror" matrix of this type: e.g. for n = 2 m = [1 2 2 1;1 2 2 1] e.g. for n = 3 m = [1 2 3 3 2 1...

12年弱 前

解決済み


polar inertia
given locations of a set of unit masses on complex plane, find polar moment of inerta about the origin. for example output 4 if ...

12年弱 前

解決済み


DNA Pattern Match: Performance Metric - Speed
The Challenge is to Rapidly find matches of DNA sequences, Length=6, in a 1,800,000 long DNA file. At <http://imacst.com/issu...

12年弱 前

解決済み


Find: Faster Alternatives for Large Sorted/Unique Vectors
The Challenge is to create faster Find methods for large unique ascending vectors. Methods exist that are 1000 times faster t...

12年弱 前

解決済み


Ordinal numbers
Given an integer n, return the corresponding ordinal number as a character string. For example, ord(1)='1st' ord(2)=...

12年弱 前

解決済み


Convert a structure into a string
Convert the contents of each fields into a string. Example with an input structure s with 2 fields : s.age = '33' s....

12年弱 前

解決済み


Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...

12年弱 前

解決済み


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

12年弱 前

解決済み


It dseon't mettar waht oedrr the lrettes in a wrod are.
An internet meme from 2003 (read more <http://www.snopes.com/language/apocryph/cambridge.asp here>) asserted that readers are re...

12年弱 前

解決済み


1D DCT-II transform.
Implement a function that calculates 1D Discrete Cosine Transform <http://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II...

12年弱 前

解決済み


Find mistyped words in text (mixed-up letters)
Mistyped words are a regular occurrence in emails, texts, status updates, and the like. Many times, people send or post a second...

12年弱 前

解決済み


Nilpotent matrix
Check if matrix A is <http://mathworks.com/ nilpotent>.

12年弱 前

解決済み


New Cody Time-Out Time
Determine the New Cody Time-Out Time Consume the Maximum Possible Time without Timing out. *Score:* 60 (sec) - Time (sec) ...

12年弱 前

質問


Is this a Possible MATLAB bug? (Further strange Behavior)
I have encountered a strange behavior while solving one of the problems in Cody. I have simplified the code into the following ...

12年弱 前 | 4 件の回答 | 4

4

回答

解決済み


Unique - Very Very Large Numbers
Given a vector column, with some very large numbers, create the ascending sort and unique vector. *Input:* A (column vector)...

12年弱 前

解決済み


Mimic foldl in functional programming
Mimic the higher-order function |foldl| ( <http://en.wikipedia.org/wiki/Fold_%28higher-order_function%29 Wikipedia:Fold (higher-...

12年弱 前

解決済み


chance in percent for minimum K heads when a good coin is tossed N times?
For example, chance is 100% for minimum 0 heads when a coin is tossed 7 times. Chance is 50% for minimum 2 heads when a coin is...

12年弱 前

解決済み


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

12年弱 前

解決済み


Volume of this donut
Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

12年弱 前

解決済み


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

12年弱 前

さらに読み込む