Solved


Harmonic series counting
The function takes a positive limit as input, And counts how many terms must be summed in the harmonic series: 1/1, 1/2, 1/3, ...

28 days ago

Solved


Number Puzzle - 059

28 days ago

Solved


Number Puzzle - 086

28 days ago

Solved


Number Puzzle - 087

28 days ago

Solved


Number Puzzle - 065

28 days ago

Solved


Pluralization
Define function plu(n) that returns '' (an empty string) if n=1, or 's' otherwise. This is handy for displaying messages from a...

28 days ago

Solved


Bit to Gigabyte
1 bit = 1.25 × 10^-10 gigabytes | x is bit | y is gigabyte

28 days ago

Solved


String Logic 18
Examples: 'DIG' --> 'DG' 'IMPORTANT' --> 'IPRAT' 'DEAL' --> 'DA' 'LIMB' --> 'LM' 'MOSTLY' --> 'MSL'

28 days ago

Solved


~(*|/)
Return three quarters of n without using addition, subtraction, multiplication or division.

28 days ago

Solved


The Triangle Stone of Destiny
After passing the Square Tree, Arjun reaches the entrance of a hidden cave. In front of the cave lies a glowing triangular stone...

28 days ago

Solved


The Equation Guardian
After activating the Circle of Protection, Arjun walks deeper into the cave and reaches a massive stone door. Suddenly, a giant ...

28 days ago

Solved


The Square Tree of Power
As Arjun crosses the Dividing River, he enters a sacred clearing where a giant glowing tree stands in the center. This is the le...

28 days ago

Solved


The Square Tree of Power
As Arjun crosses the Dividing River, he enters a sacred clearing where a giant glowing tree stands in the center. This is the le...

28 days ago

Solved


Acceleration in an Atwood Machine with Massive Pulley
Engineers at Indian Institute of Technology Delhi are designing a precision elevator calibration system using two masses connect...

28 days ago

Solved


Acceleration of Block Relative to Ground
Researchers at Indian Space Research Organisation test cargo motion inside accelerating spacecraft ramps. Find acceleration.

28 days ago

Solved


Alternating sum
Given vector x, calculate the alternating sum y = x(1) - x(2) + x(3) - x(4) + ...

28 days ago

Solved


Reverse the elements of an array
Reverse the order of elements in an array: eg: input X = [ 1 2 3 ; 4 5 6 ; 7 8 9 ] o...

28 days ago

Solved


Flip the main diagonal of a matrix
Given a n x n matrix, M, flip its main diagonal. Example: >> M=magic(5); >> flipDiagonal(M) 9 24 1 ...

28 days ago

Solved


Back to basics 23 - Triangular matrix
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, return a matrix with all elements above a...

28 days ago

Solved


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

28 days ago

Solved


Find the Best Hotels
Given three input variables: hotels - a list of hotel names ratings - their ratings in a city cutoff - the rating at which yo...

28 days ago

Solved


Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...

28 days ago

Solved


Calculate BMI
Given a matrix hw (height and weight) with two columns, calculate BMI using these formulas: 1 kilogram = 2.2 pounds 1 inch = 2...

28 days ago

Solved


Matrix Construction I
Given n, construct a matrix as shown in the example below. Example For n=8, the output should look like this: 1 2 3 4 ...

28 days ago

Solved


Toeplitz Matrix
For a given square matrix of order n-by-n check whether this is a Toeplitz matrix or not. Return true if it is.

28 days ago

Solved


Find the next state of a JK Flip-Flop
Find the next state (NS) of a JK Flip-Flop based on previous state (PS), inputs. Learn more about JK Flip-Flop theory here: ...

28 days ago

Solved


Sum the Digits of a Number
Given an integer, sum the digits repeatedly until you end up with a single value less than 10. For example, if you add the di...

28 days ago

Solved


Is this matrix orthogonal?
Given a square matrix, a, determine whether it is orthogonal. INPUT: a, a n x n matrix OUTPUT: true or false

28 days ago

Solved


Three...is a magic number.
Yes it is... It's a magic number... To help you get rid of that earworm, here's a new Cody problem. You are given a squar...

28 days ago

Load more