The first few terms(Fn) of Fibonacci Numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, … For given N find the sum (Sn) of 0 ...read more
Sum
6 postsGiven N and M, distribute first N natural numbers in two sets such that the absolute sum of the numbers in the two sets is equal to M. If possible, print the ...read more
Given an array arr[] of N non-negative integers, the task is to sort these integers according to the sum of letters required to represent them. Examples: Input: arr[] = {12, 10, 31, ...read more
Given an array with n elements, task is to calculate the difference between the sum of those elements occurring at odd indexes and those at even indexes. Note : For the above ...read more
Given an array in increasing order and a target, return indices of two numbers such that they add up to the target. You have to return an array of indices where the ...read more
In this article, you will learn to calculate Sum of First n Natural numbers. The positive numbers 1, 2, 3… are known as natural numbers. The sum of natural numbers up to ...read more