Solved


Simple Past of Regular Verbs
Given a regular verb, return the simple past. Example Input verb = 'to work' Output simple_past = 'worked'

5 years ago

Solved


last n digit of a power function
Calculate the power of a given a base, exponent. Return the last n digit number. Example 1: base = 3; expo = 8; n = 3; ...

5 years ago

Solved


Leap Year
According to Gregorian Calender(which is in use now, in many countries),decide whether a given year is a leap year or not. Give...

5 years ago

Solved


FIFA World Cup 2014 : Offside
This problem is about offside rule in football (soccer). Input is a matrix with mostly zeros and a few 1, 2, 3 and 4s. A zer...

5 years ago

Solved


Best Square-Shaped Grid for Subplot
If you have x number of plots, find the optimum 'm' number of rows and 'n' number of columns for subplotting where the overall f...

5 years ago

Solved


Temperature Conversion Utility
There are a few problems on Cody regarding temperature conversion (C to K, C to F, F to C), but none include Rankine. Furthermor...

5 years ago

Solved


Mechanical Advantage of a Gear Train
Calculate the mechanical advantage of a gear train. The mechanical advantage of a gear couple is given by MA = T_o/T_i where ...

5 years ago

Solved


all possible subsets of set
Given a vector, return all possible subsets of the vector in a cell array. Properties of basic set theory is assumed to be valid...

5 years ago

Solved


Integer Sequence - II : New Fibonacci
Crack the following Integer Sequence. (Hints : It has been obtained from original Fibonacci Sequence and all the terms are also ...

5 years ago

Solved


Find the relation
Take x as input and y as output. If x=1 y=3 If x=2 y=14 If x=3 y=39 If x=4 y=84 Based on this relation find giv...

5 years ago

Solved


Text processing - Help Johnny write a letter home from camp
Johnny overuses the word 'great'. Write a script that will help him with this and future letters. If a sentence contains more ...

5 years ago

Solved


Musical Note Interval 1 - Diatonic Scale
Assuming a simple diatonic C scale, calculate the interval (integer) between two notes (provided as strings). By applying number...

5 years ago

Solved


birthday on same day of week
Say, Mr. X's birthday is on 20th July, 2014. It was Sunday. Determine the closest year when his birthday will again be on Sunday...

5 years ago

Solved


Diagonal of a Spiral Matrix
Write a function that will return same output as diag(spiral(n)). The only exception is that spiral and diag functions are not a...

5 years ago

Solved


remove single elements
Given a vector of integers, remove the elements that have appeared only once. The output elements should be in exact order as th...

5 years ago

Solved


grazing cows
Here is a fun problem I encountered in high school. Two cows are grazing in an enclosed square-shaped field of side length s ...

5 years ago

Solved


Sum of Dividend Digits
Find the smallest number that consist of only number 1's (e.g. 11111111111) which satisfy a given divisor and remainder. Then re...

5 years ago

Solved


Max Change in Consecutive Elements
If an array is given as input then find the index of consecutive elements that represent maximum change. Example: Input ...

5 years ago

Solved


How long until the weekend?
Write a function a that takes a date vector as an input and returns the number of hours until the weekend begins. The beginning...

5 years ago

Solved


Get the variable value from a string and generate sum
Get the variable value from a string. Example. x = 'A=10' y = 'B=20' Result = (x+y) Result = 30

5 years ago

Solved


Factorions: Numbers that equal the sum of the factorials of their digits
From Wikipedia: _A factorion is a natural number that equals the sum of the factorials of its decimal digits_ For example: ...

5 years ago

Solved


Text Processing - New
Derived from problem 2440. A string containing several sentences are given as input. If any sentence contains the word 'great...

5 years ago

Solved


Filter British English into American English
Given a sentence written with British spelling, return the sentence with the offending word(s) replaced with the American spelli...

5 years ago

Solved


weekday and month
Given a year and a weekday, determine how many months of that year had five of those weekdays. It is kind of easy to find. Ex...

5 years ago

Solved


expand intervals
You're given a row vector of an even number of monotonically increasing integers. Each pair of consecutive integers is the lower...

5 years ago

Solved


Convert a grayscale image into RGB colour format, preserving data type
In the Image Processing Toolbox, MATLAB provides rgb2gray to convert a 3 channel color image into a 1 channel intensity...

5 years ago

Solved


Determine if given number is perfect
A number is <http://en.wikipedia.org/wiki/Perfect_number perfect> if it is equal to the sum of its factors, excluding itself. ...

5 years ago

Solved


compress sequence into intervals
You're given a row vector of monotonically increasing integers most of which are consecutive. Find the upper and lower bounds of...

5 years ago

Solved


Do operation as per given string
Do operation as per given string Example: '3*5' then answer must be 15; '3+5' then answer must be 8; '35' then answer ...

5 years ago

Solved


expand intervals vol.2
Similar to problem <http://www.mathworks.co.uk/matlabcentral/cody/problems/2528 2528>. This is a more general case, when bounds ...

5 years ago

Load more