Solved

How many points lie within the rectangle and how many aren't?

Suppose, you are given the coordinates of bottom-left and top-right corners of a rectangle as *input-1, R* i.e *R=[Bottom-left c...

2 months ago

Problem

How many points lie within the rectangle and how many aren't?

Suppose, you are given the coordinates of bottom-left and top-right corners of a rectangle as *input-1, R* i.e *R=[Bottom-left c...

2 months ago | 0

Solved

Is the Point in a Triangle?

Check whether a point or multiple points is/are in a triangle with three corners Points = [x, y]; Triangle = [x1, y1; x...

2 months ago

Solved

Find the next binary palindrome number

We all know, a *palindrome* is nothing but a number or character which remains the same after the forward or backward alteration...

2 months ago

Problem

Find the next binary palindrome number

We all know, a *palindrome* is nothing but a number or character which remains the same after the forward or backward alteration...

2 months ago | 0

Solved

Verify Law of Large Numbers

If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

2 months ago

Solved

Find the Oldest Person in a Room

Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

2 months ago

Solved

Binary numbers

Given a positive, scalar integer n, create a (2^n)-by-n double-precision matrix containing the binary numbers from 0 through 2^n...

2 months ago

Solved

Find the sides of an isosceles triangle when given its area and height from its base to apex

Find the sides of an isosceles triangle when given its area and the height from its base to apex. For example, with A=12 and ...

2 months ago

Solved

Converting binary to decimals

Convert binary to decimals. Example: 010111 = 23. 110000 = 48.

3 months ago

Solved

Count decimal digits of a number

* Given an integer number you have to return the number of its digits. * For example 248 has 3 digits and 1589 has 4 digits ...

3 months ago

Solved

Given an unsigned integer x, find the largest y by rearranging the bits in x

Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

3 months ago

Solved

Find out sum and carry of Binary adder

Find out sum and carry of a binary adder if previous carry is given with two bits (x and y) for addition. Examples Previo...

3 months ago

Solved

Project Euler: Problem 2, Sum of even Fibonacci

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

3 months ago

Solved

Where do the maximum number belongs within a 3-D matrix?

Suppose, you are given two variables *a* and *b* as inputs in 2-D format. Find out, where do the maximum number belongs (as out...

3 months ago

Solved

Count the non-zero elements along the diagonals that are immediately next to the main diagonal

Suppose, you are being told to write a matrix, *a* as input in MATLAB with having the possibility of containing zero and non-zer...

3 months ago

Question

Out of memory Problem [Problem 2 , Project Euler (Sum of even Fibonacci numbers)]

%When i tried x=597455000 it straightly said, out of memory problem. %How can i fix this problem ? %Give me some advices fu...

3 months ago | 2 answers | 0

Solved

Number of Even Elements in Fibonacci Sequence

Find how many even Fibonacci numbers are available in the first d numbers. Consider the following first 14 numbers 1 1 2...

3 months ago

Solved

How many Fibonacci numbers?

Find the number of unique Fibonacci numbers (don't count repeats) in a vector of positive integers. Example: x = [1 2 3 4...

3 months ago

Solved

Weighted average

Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

3 months ago

Solved

Fibonacci-Sum of Squares

Given the Fibonacci sequence defined by the following recursive relation, * F(n) = F(n-1) + F(n-2) * where F(1) = 1 and F(1)...

3 months ago

Question

Sorting an array of numbers in descending order by using while loop

I wrote the code to sort number in descending order but my code failed to do so (actually i was the failure lol). Example: Cons...

3 months ago | 2 answers | 0

Solved

Sort a list of complex numbers based on far they are from the origin.

Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

3 months ago

Solved

Sum of diagonal of a square matrix

If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

3 months ago

Solved

Summing digits

Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

3 months ago

Solved

Return the 3n+1 sequence for n

A Collatz sequence is the sequence where, for a given number n, the next number in the sequence is either n/2 if the number is e...

3 months ago