Feeds
已解决
Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.
2 years 前
已解决
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...
2 years 前
已解决
Calculate the Hamming distance between two strings
Inspired by a similar Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-dist...
2 years 前
已解决
Reverse the Words (not letters) of a String
*Description* Change the words of a string such that the words appear in reverse order. You may assume that the string is a n...
2 years 前
已解决
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....
2 years 前
已解决
Calculate a modified Levenshtein distance between two strings
Inspired by the Cody problem found <http://www.mathworks.com/matlabcentral/cody/problems/93-calculate-the-levenshtein-distance-b...
2 years 前
已解决
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...
2 years 前
已解决
Without the French accent please!
Suppress the French accent. Example 'Déjà présent' -> 'Deja present'
2 years 前
已解决
Transposition as a CIPHER
This all about transcripting a text message. If the input string is: s1 = 'My name is Sourav Mondal', then the output is: s2 = '...
2 years 前
已解决
Return the first and last characters of a character array
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...
2 years 前
已解决
Decimal Comparison
*Background* A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...
2 years 前
已解决
Pair Primes
Let's define pair primes as follow; * *For 2 digits numbers:* 11 and 17 are pair primes because both of them are 2 digits pri...
4 years 前
已解决
Ned's queens
A tribute to Cody's five-year anniversary should also celebrate the people behind Cody, and in this particular case, our illustr...
4 years 前
已解决
N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...
4 years 前
已解决
Successive zeros
Suppose n is the number of digits a number contains. Now, 12032 - is a valid n=5 digit number. But 10023 - is defined as i...
4 years 前
已解决
Is this a valid Tic Tac Toe State?
For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M. ...
5 years 前
已解决
Cache me Outside
The test suite includes a simple recursive Fibonacci sequence generator, but it's terribly inefficient. One simple method for im...
5 years 前
已解决
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 ...
5 years 前
已解决
Read a column of numbers and interpolate missing data
Given an input cell array of strings s, pick out the second column and turn it into a row vector of data. Missing data will be i...
5 years 前
已解决
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...
5 years 前
已解决
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...
5 years 前
已解决
Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...
5 years 前
已解决
Add more zeros
Find code that adds one 0 to each sequence of 0 in a string (composed with only 0 or 1). For example: '1010' -> '100100' ...
5 years 前
已解决
Ordinal numbers
Given an integer n, return the corresponding ordinal number as a character string. For example, ord(1)='1st' ord(2)=...
5 years 前
已解决
Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...
5 years 前
已解决
Bang Bang in Bangalore
Imagine a strange language disorder, Bangolangosis, has developed among trigonometricians of <http://en.wikipedia.org/wiki/Banga...
5 years 前
已解决
Split a string into chunks of specified length
Given a string and a vector of integers, break the string into chunks whose lengths are given by the elements of the vector. Ex...
5 years 前
已解决
Cell Counting: How Many Draws?
You are given a cell array containing information about a number of soccer games. Each cell contains one of the following: * ...
5 years 前
已解决
Guess Cipher
Guess the formula to transform strings as follows: 'Hello World!' --> 'Ifmmp Xpsme!' 'Can I help you?' --> 'Dbo J ifmq zpv...
5 years 前
已解决
One track five lanes
Find the minimum number of lane changes necessary to cross the entire track without running into any obstacles <<http://www.a...
6 years 前