## find the Arithmetic Progression sequence

Given a first element a and common difference d of an arithmetic progression. Write a program to print the first … Read more

## Find the Nth-term in a given arithmetic progression

Given a first element a and common difference d of an arithmetic progression. Write a program to find the nth … Read more

## Departure and Destination Cities in a given itinerary

You are on a business trip and traveling from one city to another. you have a stack of unsorted flight … Read more

## Given an array, rank its elements

Given an array of numbers, write a program to rank the array elements. Example: Given array: [22, 11, 44, 66, … Read more

## Find Three Consecutive Odd Numbers in an array

GIven an array of numbers, find out if array contains three consecutive odd numbers Example: [2, 4, 1, 3, 4, … Read more

## Convert to Non-decreasing Array with one change

Given an array of numbers, you need to find out whether an array can be converted to a non-decreasing array … Read more

## In an array, Duplicate the zeroes without expanding it

Given an array of numbers, you need to duplicate the zero’s in the array. Do not extend the size of … Read more

## Convert a Decimal number to its representation

Given a decimal number, convert that number to its binary representation. Example:  Number: 5, binary representation: 101 Number: 8, binary … Read more

## Maximum Consecutive Ones in a given array

Given a binary array (contains only 0’s and 1’s), find out the number of maximum consecutive ones.  Example: Input: [0, … Read more

## Duplicate even elements in an array

Given an array of numbers, write a program to duplicate the even numbers and return the new array. Example: Input: … Read more

## In a number, add digits until it becomes a single digit

Write a program to add the digits of the given number until the number becomes a single digit number. Example: … Read more

## Find the number of pairs with odd XOR

Given an array of integers, write a program to find the number of pairs for which the XOR is an … Read more

## Add digits until the number becomes a single digit

Write a program to add the digits of the given number until the number becomes a single digit number. Example: … Read more

## Remove Duplicates in a given Sorted Array

Given a sorted array of integers, write a program to remove duplicates in-place by modifying the given array such that … Read more

## Random character in a given string – Java

Given a string, write a function that returns a random character from the string.  Example: Given string = algorithms @ … Read more