Matrix rotation as per given angle
Given a user defined matrix and angle of rotation, rotate the elements of output matrix as clockwise or anti-clockwise. Angle wi...
3 years ago
Solved
Cumulative difference
Given an array, return the cumulative difference.
Example
a = [ 1 3 5 7 ]
cumdiff = [ 1 2 1 -2 ]
Draw a triangle of ones
For any given n, return a matrix that includes a triangle of ones of height n:
Example
n = 3
output = [0,0,1,0,0
...
3 years ago
Solved
Energy of an object
Calculate the total mechanical energy of an object.
Total Energy= Potential energy + Kinetic energy
P.E.=m*g*h
K.E.=1/2...
3 years ago
Solved
Find all prime factors of the input
Given an input x, find its all prime factors. Return the vector with all factors in ascending order.
Efficiency is the key here...