Solved


Mo money, mo math #2! (★★★)
(adapted from Prob 9 Cody team) You have a matrix for which each row is a person and the columns represent the number of quar...

1 year ago

Solved


Return the sequence element II
Given positive integers x and n, return a positive integer, y, which is the nth term in the <https://en.wikipedia.org/wiki/Juggl...

1 year ago

Solved


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for.

1 year ago

Solved


Pairwise column flip
Given matrix *M_in*, flip every pair of columns. So if *M_in* is 1 2 3 4 1 2 3 4 then *M_out* is 2 1 4 3 2 1 4 3 ...

1 year ago

Solved


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

1 year ago

Solved


Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

1 year ago

Solved


How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

1 year ago

Problem


Calculating the Union Area of Overlapping Rectangles
Calculate the area covered by a union of multiple rectangles. Each rectangle is represented by 4 integers: the first two integer...

1 year ago | 3 | 8 solvers

Problem


Reversing Maximal Ascending Subsequences
Create and return a new array that contains the same elements as the input array, but with the elements within each strictly inc...

1 year ago | 0 | 8 solvers

Problem


Largest Rectangle Area in a Histogram
Given a histogram represented by an array of integers, e.g., [2, 1, 4, 5, 1, 3, 3] : find the maximum area of a rectangle tha...

1 year ago | 2 | 6 solvers

Problem


Secret Message and Acrostic
One of the simplest ways to hide a message involves utilizing uppercase letters. Given a text, collect all uppercase letters in...

1 year ago | 0 | 13 solvers

Solved


No of squares in a grid
given a m*n grid calculate the no of possible squares & rectangles on that grid. output: y=[no of rectangles , no of sqa...

1 year ago

Solved


How many rectangles in a grid ?
How many rectangles are there in an m × n grid ? For example, if m=1 & n=2, we have 3 rectangles.

1 year ago

Solved


Area-04
The dimension of a rectangle is given. There are two circles of equal size that are inscribed inside it.The circles are tangent ...

1 year ago

Solved


Dominant Matrix - 01
A matrix is said to be diagonally dominant if for every row of the matrix, the magnitude of the diagonal entry in a row is large...

1 year ago

Solved


Exhaust all possible logical vectors
Input a length argument and list all possible logical vectors of that length. My solution is of size 29. Can you find an even s...

1 year ago

Solved


Create a column vector of n elements between a and b (both included)
Given lower limit a and an upper limit b, create a column vector of n elements inclusive of a and b. For example: a = 1, b = 4,...

1 year ago

Solved


Make the first letter of a sentence Capital.
In this problem you will be given a string of 2 or 3 lines. Your work is to make the first letters of every line Capital. You wi...

1 year ago

Solved


XOR fibonacci
a & b are the first two terms in the xor fibonacci sequence. Find the nth term of that sequence. XOR fib sequence is that in ...

1 year ago

Solved


Return longest string in 1-D array of strings
Find the longest string in an array of strings. Return an empty string if the initial array is empty. If there are multiple stri...

1 year ago

Solved


String Manipulator
Write a script that takes a string as an input and returns a cell array containing – I. the count of vowels. II. Find the ind...

1 year ago

Solved


7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: http://e...

1 year ago

Solved


Half?
If you toss an even number (x) of coins, what is the probability (y) of 50% head and 50% tail?

1 year ago

Solved


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

1 year ago

Solved


Convert Hard Drive marketing sizes to actual data sizes
Hard drive sizes are typically marketed using the decimal meaning of prefixes, whereas RAM uses binary meanings. For example: ...

1 year ago

Solved


remove nans fast
There are several ways to locate and remove nans in a matrix, and return an 1d row vector. In this problem the challenge is ...

1 year ago

Solved


Find the quantization index of an analog value using a 6-bit quantizer.
Given a sinusoidal waveform x(t)=4.5*sin(2*pi*100*t) is sampled at 8000 sample per second. Assume that signal range is between -...

1 year ago

Solved


Gambler?
Given a handle to a wealth function, confirm within 100 milliseconds 'Millionaire', 'Likely', or 'Gambler', if wealth() returns ...

1 year ago

Solved


Back to basics 18 - justification
Covering some basic topics I haven't seen elsewhere on Cody. Given a string with extra spaces in front and/or in back, return...

1 year ago

Load more