Solved


Kaprekar Steps
6174 is the Kaprekar constant. All natural numbers less than 10,000 (except some with same digits) can be reduced to 6174 in the...

1 year ago

Solved


How many revolutions around the earth
Calculate how many revolutions you will around the earth till 1/1/2100. Given the birhdate find your age in number of days on 1...

1 year ago

Solved


Word with Highest Frequency
Write a MATLAB function that takes in a string and returns the word with the highest frequency in the string. The function shoul...

1 year ago

Solved


Convert row and column subscripts to linear indices
Convert 2D row and column subscripts to linear indices WITHOUT sub2ind Example: row = [1 2 3 1]; col = [2 2 2 3]; sz = [3 3]...

1 year ago

Solved


Matrix spiral
Make a spiral in a (n*n) matrix. The spiral has to start in the top left, and has to rotate clockwise to the center. The spiral ...

1 year ago

Solved


Word Distance - Sum
Let's suppose that the distance of a word can be calculated by summing the differences between its letters, having assigned the ...

1 year ago

Solved


Finding valleys
You have a vector of altitudes (units are arbitrary) and need to find the depths of all the valleys. You also need to determine ...

1 year ago

Solved


Calculate the volume of the intersection of two balls
Consider two balls (solid spheres) in , with radius and respectively. Suppose that the distance between the centers of the two...

1 year ago

Solved


Sign of IEEE Single
Output the sign bit of the IEEE representation of the single-typed 32-bit float input as the uint8 "1" or the uint8 "0".

1 year ago

Solved


Minimum number of crossings in a complete bipartite graph
This problem is related to problem 58389. A complete bipartite graph may be drawn in different ways, such that the number of li...

1 year ago

Solved


Determine whether a number is prome
In discussing the unique factorization of numbers in Elementary Number Theory, Underwood Dudley devised a new number system: “C...

1 year ago

Solved


Draw '5' in Chinese.
Draw a x-by-x matrix '五' using 1s and 0s. Example: x=5 ans= [1 1 1 1 1 0 1 0 0 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 1] x=7...

1 year ago

Solved


Create an empty array
Suppose you need an empty array. e = [] will give you one, but it's a double array, which may not help if you need a differen...

1 year ago

Solved


Find the circle inscribed in a triangle
Write a function that takes the x- and y-coordinates of three points describing the vertices of a triangle and returns the cente...

1 year ago

Solved


Continuous NaNs - I
Remove any continuous NaNs that appear in the array - %Example 1 input = [1 NaN 2 NaN NaN 3 NaN NaN NaN] output = [1 NaN 2 ...

1 year ago

Problem


Continuous NaNs - I
Remove any continuous NaNs that appear in the array - %Example 1 input = [1 NaN 2 NaN NaN 3 NaN NaN NaN] output = [1 NaN 2 ...

1 year ago | 0 | 9 solvers

Solved


Find circular arc length, sector area and segment area
Given a circular arc passing through the points P = [ x1 y1 ] and Q = [ x2 y2 ] such that the center angle of the arc (in degree...

1 year ago

Solved


Generate a Parasitic Number
This problem is the next step up from Problem 156. Rather than determining if an input is a parasitic number, you will be asked ...

1 year ago

Solved


Sequence Vectorization - II
This is the second part to the question - Sequence Vectorization - I Given an array of Natural numbers, N, return the sequence ...

1 year ago

Solved


Easy Sequences 110: Integration of the Sum of a Recursive Trigonometric Function
A trigonometric function, , is defined as follows: , in radians Applying recursively we define another funct...

1 year ago

Solved


Easy Sequences 109: Summation of Derivatives of a Trigonometric Function
A trigonometric function, , is defined as follows: where: ; and ...

1 year ago

Solved


Determine the minimum number of swaps to sort a vector
Cody Problem 1401 asks us to sort a vector with the bubble sort algorithm and count the number of swaps needed. For example, to ...

1 year ago

Solved


Flag a convertible string
If a string is able to be entirely converted to an integer, return a "true" flag. Otherwise, return a false flag. For example: ...

1 year ago

Solved


007: Chinese Barrack Invasion
*MISSION:* Successfully invade a military barrack located in China. *WARNING:* There is a row of _n_ security switches protec...

1 year ago

Solved


Solve an ODE: separable equation
Solve the following ordinary differential equation: with the initial condition .The test suite will ask for the value of the ...

1 year ago

Solved


MatCAT - Reconstruct X from Its X-rays
Consider a matrix x x = [ 1 2 0 0 5 0 3 0 8 ] If we sum x along the rows we get row_sums = [3 5 11] ...

1 year ago

Solved


Easy Sequences 104: One-line Code Challenge - GCDs of Sum of Consecutive Cubes
For a natural number, n, the function CC(n) is defined as follows: In other words, CC(n) is the sum of cubes ...

1 year ago

Solved


Easy Sequences 105: One-line Code Challenge - IPv4 Address Validation
The Internet Protocol version 4 (IPv4) is the dominant protocol for routing devices over the internet. IPv4 addresses are usuall...

1 year ago

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

1 year ago

Load more