Solved


Calculator spelling - Letters to Numbers
Using the numbers on a calculator, and rotating the display 180 degrees, many words can be spelled. In particular, the following...

9 months ago

Solved


Check if a year is a leap year or not
Return 1 if a given year is a leap year or 0 if it is not

9 months ago

Solved


Most Frequent Word - 01
Given a document file or a character array, find out the most frequent word in that document. In the case of multiple words -...

9 months ago

Solved


Compute the harmonic numbers
The nth <https://mathworld.wolfram.com/HarmonicNumber.html harmonic number> is defined as the sum of the reciprocals of the inte...

9 months ago

Solved


Where do the maximum number belongs within a 3-D matrix?
Suppose, you are given two variables a and b as inputs in 2-D format. Find out, where do the maximum number belongs (as output c...

9 months ago

Solved


Calculate the h-index
H-index is a powerful tool for quantifying the scientific contribution of a researcher. H-index is defined as follows (source - ...

9 months ago

Solved


Binary
Given a positive, integer n, create a function that returns the respective binary number in the form of a vector. Example: ...

9 months ago

Solved


Matrix FUN
Given a Matrix M, find out the number of elements of matrix that are divisible by 3. M = [1 2 3;4 5 6;7 8 9]; ou...

9 months ago

Solved


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

9 months ago

Solved


Encode Me From The Past
Given this input x = 2, 5, 1, 2, 4, 1, 1, 3 output should be (Five 2's, Two 1's, One 4, Three 1's) [2 2 2 2 2 1 1 4 1...

9 months ago

Solved


Count the peaceful queens
In a 5x5 chessboard with a queen of one color (white, say) on the perimeter, one can place 12 black queens on the board such tha...

9 months ago

Solved


Eliminate Polysyllabics: Long live short words!
Given a string s1, return s2 in which all the words with more than one syllable have been removed. To make things simple, we ...

9 months ago

Solved


Concatenate strings
concatenate a variable number of input strings to produce one outputstring

9 months ago

Solved


Morse Code Generator! Try it!
.... . .-.. .-.. --- . ...- . .-. -.-- --- -. . -.-.-- .-.. . - ... -.. --- ... --- -- . -- --...

9 months ago

Solved


Prime number check (★★)
One way to see if a number x is prime is to compute the remainders obtained when dividing x by all integers from 2 to √(x). If x...

9 months ago

Solved


Determine which fields have been modified in a structure
Given two input structures (s1, s2), determine which field values have been modified in s2 compared to s1. Your output should be...

9 months ago

Solved


Get ranks of values in a vector
For a given vector, say [6 3 8 2], return the ranks (ascending) of observations, i.e. [3 2 4 1]. Do not worry about tied ranks. ...

9 months ago

Solved


Find out the Gray Code for a Given Binary Number
Find out <http://en.wikipedia.org/wiki/Gray_code Gray Code> for a given binary number Example Binary input 1000 Gray ...

10 months ago

Solved


Modified run-length companion vector
Given a vector x, return a vector that indicates the run length of any value in x. Each element in output vector shows how many ...

10 months ago

Solved


Multiply each matrix element by its row index and add its column index.
Return a matrix the same size as the input, multiply each element by its row index and add its column index. Example: x = [ 1 ...

10 months ago

Solved


Increasing sub-sequence (Level 1)
Given a vector, v, of real numbers, return a positive integer, n, representing the longest contiguous increasing sub-sequence co...

10 months ago

Solved


The prisoner
"We want information, information, information." "Who are you?" Input can be a string or a number (array).

10 months ago

Solved


Permutation
How many different words can be formed using all the letters(together) from a given input word? Input is a string.

10 months ago

Solved


MinMax
* x=[2 4 3 1 6 4 6] * output , y=[1 6 2 4 3] here,y(1) is the minimum of x, y(2) is the maximum of x, y(3) is the 2nd mini...

10 months ago

Solved


Replace all zeros and NaNs in a matrix with the string 'error'
Given a numeric input matrix A, possibly containing some zero values and some NaNs, replace any occurrences of zero or NaN with ...

10 months ago

Solved


Bell Number calculator
Calculate a vector of Bell numbers for sets up to length n. Bell numbers are the maximum number of partitions of a set. See the ...

10 months ago

Solved


Bell Triangle
Form the bell triangle upto nth bell number posotion; * if n=5 * y= [1 0 0 0 0; 1 2 0 0...

10 months ago

Solved


Find the Final State of an Abelian Sandpile
Let us define an <http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile> as a matrix that is only...

10 months ago

Load more