Community Profile

# praharsh

164 total contributions since 2017

View details...

Contributions in
View by

Solved

Test if a Number is a Palindrome without using any String Operations
*Description* Given an integer _X_, determine if it is a palindrome number. That is, _X_ is equal to the _X_ with the digits ...

4 mois ago

Solved

Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

4 mois ago

Solved

Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

4 mois ago

Solved

Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the s...

4 mois ago

Solved

Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<http://upload...

4 mois ago

Solved

Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

4 mois ago

Solved

Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

4 mois ago

Solved

Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return *true* if the triangle with sides a, b and c is righ...

4 mois ago

Solved

Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...

4 mois ago

Solved

Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

4 mois ago

Solved

Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

4 mois ago

Solved

Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

4 mois ago

Solved

Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2...

4 mois ago

Solved

Make a random, non-repeating vector.
This is a basic MATLAB operation. It is for instructional purposes. --- If you want to get a random permutation of integer...

4 mois ago

Solved

Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.

4 mois ago

Solved

Number of 1s in a binary string
Find the number of 1s in the given binary string. Example. If the input string is '1100101', the output is 4. If the input stri...

4 mois ago

Solved

Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

4 mois ago

Solved

Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

4 mois ago

Solved

Return area of square
Side of square=input=a Area=output=b

4 mois ago

Solved

Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

4 mois ago

Solved

Solitaire Cipher
Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>. Since this is from Wikipedia, I am capturin...

4 mois ago

Solved

Find the biggest empty box
You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...

5 mois ago

Solved

Implement simple rotation cypher
If given a letter from the set: [abc...xyz] and a shift, implement a shift cypher. Example: 'abc' with a shi...

5 mois ago

Solved

Given a window, how many subsets of a vector sum positive
Given a vector: [1 0 -1 3 2 -3 1] and a window of 2, A sliding window would find: 1 + 0 = 1 0 - 1 = -1 ...

5 mois ago

Solved

How many trades represent all the profit?
Given a list of results from trades made: [1 3 -4 2 -1 2 3] We can add them up to see this series of trades made a profit ...

5 mois ago

Solved

Flag largest magnitude swings as they occur
You have a phenomenon that produces strictly positive or negative results. delta = [1 -3 4 2 -1 6 -2 -7]; Marching thr...

5 mois ago

Solved

Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...

5 mois ago

Solved

Words Count: A Cell Array Approach
Given an input character vector consisting of words, punctuation marks, white spaces, and possibly newline characters (\n), arra...

5 mois ago

Solved

How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

5 mois ago

Solved

Spot the outlier
All points except for one lie on a line. Which one is the outlier? Example: You are given a list of x-y pairs in a column ...

5 mois ago