## Move all Negative Numbers to Beginning and Positive to End with Constant Extra Space

Suppose you have an array of integers. It consists of both negative and positive numbers and the problem statement asks to shift/move all the negative and positive elements to the left of the array and to the right of the array respectively without using extra space. Example  Input: arr[]={2,4,-10,13,-7,-60,52,8,-19 } …

## Check if two arrays are equal or not

The problem “Check if two arrays are equal or not” states that you are given two arrays. The problem statement says that you have to determine if given arrays are equal or not. Example arr1[] = { 1, 4, 2, 5, 2 }; arr2[] = { 2, 1, 5, 4, …

## Print Fibonacci sequence using 2 variables

Problem Statement The problem “Print Fibonacci sequence using 2 variables” states that you need to print the Fibonacci sequence but there is a limitation of using only 2 variables. Example n = 5 0 1 1 2 3 5 Explanation The output sequence has the first five elements of the …

## Palindrome Number

Problem Statement the problem “Palindrome Number” states that you are given an integer number. Check if it is a palindrome or not. Solve this problem without converting the given number into a string. Example 12321 true Explanation 12321 is a palindrome number because when we reverse 12321 it gives 12321 …

## Reverse a String

Problem Statement “Reverse a String” problem states that you are given a string s of size n. Write a program to reverse it. So, what does reversing a string means? It generally means reversing the input string that we are given. That is it is defined as an operation doing …

## Special Number

What can be so special about a number? Let us find out. We have with us an array of N numbers. A number can be special if it is divisible by one or more numbers except for the number itself. Firstly let us clear this with a few examples before …

## Reverse a Number Using Stack

In reverse a number using stack problem we have given an integer variable representing a number. Print the reverse the given number using stack. Example Input : 12345 Output : 54321 Input : 207 Output : 702 Explanation for Reverse a Number Using Stack Let number n = 12345 Start traversing and store the …

## Valid Palindrome

Given a string s of length n. Write a program to find if the string is valid palindrome or not. If not you may delete at most one character from the string to make it a palindrome. Any string which is the same as it’s reverse is known as a …