Solved


Acid-Base Chemistry: Which side of the reaction is more favorable?
In an Acid-Base reaction, there is always going to be an acid, a base, a conjugate acid, and a conjugate base. When provided wit...

1 month ago

Solved


Is the number of 1s in a binary integer odd or even?
Your function should turn the input integers into binary form and count the number of 1s in the binary. If the number is odd, re...

1 month ago

Solved


List numbers that are not in the Fibonacci sequence
In the list of 4797 Cody problems, 53 deal with or refer to the Fibonacci sequence.* What about the other numbers? Write a funct...

1 month ago

Solved


Exact Cover
An efficient solution to the exact cover problem can be useful in many situations. In this problem, you are welcome to use Knuth...

1 month ago

Solved


Slope intercept application
Find y given slope (m), x, and y intercept (b).

1 month 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

1 month ago

Solved


Remove Duplicates
Remove duplicates from the vector of integers and display in sorted order

1 month ago

Solved


Compute the drag on a moving vehicle
We assume no rolling resistance, and the simple rule for Drag : , where is the density of the fluid (assumed at 1.2 ), is the ...

1 month ago

Solved


Determine if vector has any zeroes
Return 1 if vector has atleast 1 zero, else return 0

1 month ago

Solved


IQpuzzler Challenge #1: Find all possible solutions with 2 pieces already on the board and fixed orientation of all other pieces
IQpuzzler is a one player board game. The 2D version provides a rectangular board with 5-by-11 spaces and 12 colored pieces (con...

1 month ago

Solved


IQpuzzler Preparation #3: Detect isolated groups of zeros in a matrix
Return true if any small, rectangular shaped, isolated groups of zeros (size 1x1, 1x2, 2x1, 1x3, 3x1 or 2x2) are present in a ma...

1 month ago

Solved


IQpuzzler Preparation #2: Detect isolated zeros in a 2D matrix
Return true if any isolated single zeros are present in the input M-by-N matrix (zeros with all adjacent elements being non-zero...

1 month ago

Solved


IQpuzzler Preparation #1: Find all non-identical orientations of a matrix
Return all non-identical orientations of a 2-D matrix that can be produced by rotating or flipping it. Input is an M-by-N matri...

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

1 month ago

Solved


nth permutation of 11...100...0
Given some number of ones and zeros, numOnes and numZeros respectively, find the nth permutation of the vector [ones(1,numOnes),...

1 month ago

Solved


Cluster Partition
Given an array (row or column) of numbers, divide the array into consecutive positive/negative numbers. 0 is to be treated inde...

1 month ago

Solved


Canadian Conundrum
After succesfully completing the French Conundrum, you have decided to take a vacation. Your trip is amongst the mighty mountai...

1 month ago

Solved


French Conundrum
The French army is trapped, sorrounded in backwards direction (South and West directions) by enemy traps and ambushes. You are n...

1 month ago

Solved


Easy Sequences 78: Trailing Zeros of Factorial Numbers at any Base
Given an integer and a number base , write a function that calculates the number of trailing zeros of the factorial of when wr...

1 month ago

Solved


how to determine is a point is inside, on or outside a polygon?
design function determines whether the point is inside a contour, outside, or lies on an edge (or coincides with a vertex). It r...

1 month ago

Solved


Zero or hero
A number will be given as an input. You can be hero if it's not zero. (Just for fun)

1 month ago

Solved


Identifying teenager
Suppose the age of a person is given. If he/she is a teenage, answer is 'yes'. Otherwise, the answer is 'no'.

1 month ago

Solved


Create spiral matrices
Create a matrix of a given size with sequential elements spiraling inward. For matrix height m and width n, the output should ...

1 month ago

Solved


Korselt's Criterion
A composite integer n (n>=2) divides b^n-b, i.e. mod(b^n-b,n)==0, for all integers b if and only if n is square-free (doesn't ha...

1 month ago

Solved


Sum of Consecutive Positive Integers Equals Product of Limiting Values
Determine m and n for the following equation: For example: 3 + 4 + 5 + 6 = 6*3 is the first occurance that satisfies the equat...

1 month ago

Solved


Heronian Triangles with Consecutive Integral Sides and Integral Area
Hero's area formula for any triangle with sides a, b, c is: . Heronian triangles are triangles having integral sides and integr...

1 month ago

Solved


Leonardo primes
Leonardo numbers are defined by following recurrence relation: Leonard prime is Leonardo number which is also prime (see ...

1 month ago

Solved


Area under the curve
Compute area under the curve specified by points stored in y, where y is in range (0,inf) and x time step is 1. note: please r...

1 month ago

Solved


Tracer un carré de côté a et de centre O
Définir une fonction carre qui prend en entrée un salaire a et un vecteur O de deux élements représentant les coordonnées cartés...

1 month ago

Solved


Intrication de deux vecteurs
Ecrire une fonction "intric" qui prend en entrée un vecteur ligne v1 et un vecteur ligne v2 et renvoie le vecteur ligne vres don...

1 month ago

Load more