Solved


Count the ones in a divisibility matrix
Cody Problem 59506 asked solvers to compute the determinant of matrix consisting of ones in the first column and anywhere the ro...

3 months ago

Solved


Beam me up, Scotty!
It's the mid 22nd century. You, Montgomery Scott, are appointed the chief engineer of the Starship Enterprise. The Starship is...

3 months ago

Solved


Update course numbers and abbreviations
Suppose that the educational institution where you teach purchases new software to handle many essential functions, including co...

3 months ago

Solved


Palindrome Checker
Create a MATLAB function that checks whether a given string is a palindrome or not. A palindrome is a word, phrase, number, or o...

3 months ago

Solved


List the ways to write 1/n as the sum of two unit fractions
Cody Problem 59841 involved counting the ways that can be written as the sum of two unit fractions (those with a numerator of 1...

3 months ago

Solved


Find the triplet
Given an array x of size n > 3 and an integer N, return the indices of three elements in the array that sum up to the given inte...

3 months ago

Solved


Interval Compression
Given a set of integers, the task is to create a list of closed intervals where each interval includes its endpoints. For exampl...

3 months ago

Solved


Compute the area of a lune
Write a function to compute the area of the shaded moon-shaped region in the figure below—that is, the area of a smaller circle ...

3 months ago

Solved


Robust Corner Product with Special Value Handling in Arrays
Compute the product of the corner elements of an array (vector or matrix). If any corner element is NaN, return NaN. If any co...

3 months ago

Problem


Robust Corner Product with Special Value Handling in Arrays
Compute the product of the corner elements of an array (vector or matrix). If any corner element is NaN, return NaN. If any co...

3 months ago | 0 | 7 solvers

Solved


Determine the mass of a bat which strikes a ball
Given the speed, the force of the impact and the length of the trajectory calculate the mass of the bat which the player holds p...

3 months ago

Solved


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

3 months ago

Solved


Extract diagonal of sparse quadratic form
Consider the matrix A and vector v given by, A=round(sprand(5e3,1e4,1/1e4*100)*100); v=randi(10,width(A),1); Write a rout...

3 months ago

Solved


List the first of three consecutive square-free numbers
The numbers 13, 14, and 15 are consecutive, of course, but they also share the property of being square-free. That is, each numb...

3 months ago

Solved


Express numbers as the sum of a prime, a square, and a cube
While traveling on an interstate highway, I noticed a sign that gave distances to three places. The distances were 3, 8, and 9 m...

3 months ago

Solved


Calculating distance of lightning based on time delay
If we know the time delay between when we see lightning and hear thunder then we can calculate approximate distance(in meters) o...

3 months ago

Solved


finding vector pair with min angle between them
given a matrix with more than one row , compare row vectors of the given matrix and find the pair with the minumum angle between...

3 months ago

Solved


Merge two integers
We want to merge the digits of two integers having the same number of digits to obtain a new integer whose digits are obtained b...

3 months ago

Solved


Count the ways to write 1/n as the sum of two unit fractions
The number 1/2 can be written as 1/3+1/6 and 1/4+1/4, and the number 1/9 can be written as 1/18+1/18, 1/12+1/36, and 1/10+1/90. ...

3 months ago

Solved


Classify numbers as abundant, deficient, or perfect
A number is perfect if the sum of its proper divisors (i.e., divisors excluding the number itself) is equal to itself. For examp...

3 months ago

Solved


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

3 months ago

Solved


List primes of the form xy+z
Consider three consecutive integers , , and . When is the number prime? For example, if or , then the results are 17 and 37, ...

3 months ago

Solved


Extend the digamma function to negative arguments
While solving one of Ramon Villamangca’s problems, I needed the value of , where is the digamma function. However, MATLAB’s fun...

3 months ago

Solved


Identify winnable games of Take a Square
A game has a pile of tokens, and two players alternate in taking a certain number of tokens from the pile, with the constraint t...

3 months ago

Solved


Conditional transpose
You're given two vectors of the same length, x and y, which might be row or a column vectors. Your task is to ensure that y has ...

3 months ago

Solved


Find the closest geyser prime
My wife and I celebrated our honeymoon and our recent anniversary in Yellowstone and Grand Teton National Parks. After returning...

3 months ago

Solved


Delete some elements in the natural set and find the sum of the first n terms
Delete the number (except 0,1) with a complete square number from the natural set of numbers, form a new set of numbers, find th...

3 months ago

Solved


List the partitions of an integer
Several Cody problems deal with partitions of an integer, or the ways an integer can be written as the sum of positive numbers—...

3 months ago

Solved


Find the Nth number in the 8-sequence
Find the Nth number in the 8-sequence. 8, 16, 24, 32, 48, 56, 64, 72, 88, ... Hint: Refer test suites

3 months ago

Solved


Find the Nth number in the 7-sequence
Find the Nth number in the 7-sequence. 7, 14, 21, 28, 35, 42, 49, 56, 63, 77, 84, ... Hint: Refer test suites

3 months ago

Load more