# Category Archives: Mathematical

Given a number n, write a function that returns count of numbers from 1 to n that don’t contain digit 3 in their decimal representation. Examples:  … Read More
Given three corner points of a triangle, and one more point P. Write a function to check whether P lies within the triangle or not.For… Read More
Write a program to find sum of positive integers without using any operator. Only use of printf() is allowed. No other library function can be… Read More
In computer science and mathematics, the Josephus Problem (or Josephus permutation) is a theoretical problem. Following is the problem statement:There are n people standing in… Read More
Write a function Add() that returns sum of two integers. The function should not use any of the arithmetic operators (+, ++, –, -, ..… Read More
The following are the common definitions of Binomial Coefficients.  A binomial coefficient C(n, k) can be defined as the coefficient of x^k in the expansion… Read More
Given a value N, if we want to make change for N cents, and we have infinite supply of each of S = {… Read More
Given an array of integers where each element represents the max number of steps that can be made forward from that element. Write a… Read More
Difficulty Level: Rookie Given a stream of numbers, print average (or mean) of the stream at every point. For example, let us consider the stream as… Read More
Given two integers k and n, write a function that prints all the sequences of length k composed of numbers 1,2..n. You need to print… Read More
Given a cost matrix cost[][] and a position (m, n) in cost[][], write a function that returns cost of minimum cost path to reach… Read More
Given that integers are read from a data stream. Find median of elements read so for in efficient way. For simplicity assume there are no… Read More
Given a positive number n, write a function isMultipleof5(int n) that returns true if n is multiple of 5, otherwise false. You are not allowed… Read More
Backtracking is an algorithmic paradigm that tries different solutions until finds a solution that “works”. Problems which are typically solved using backtracking technique have the… Read More
The Fibonacci numbers are the numbers in the following integer sequence.0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, …….. In… Read More