This time it was quite easy ..
1.
.. No splitting of array must be done or No additional spaces must be used for storing the array..
Eg: RACE CAR
Eg: I DID, DID I ?
2.
. After the modification, rearrange the array such that all 0’s are shifted to the end.
Input : arr[] = {2, 2, 0, 4, 0, 8}
Output : 4 4 8 0 0 0
Input : arr[] = {0, 2, 2, 2, 0, 6, 6, 0, 0, 8}
Output : 4 2 12 8 0 0 0 0 0 0
3 .
A number is said to be twisted prime if it is a prime number and reverse of the number is also a prime number.
Input : 97
Output : Twisted Prime Number
Explanation: 97 is a prime number
and its reverse 79 is also a prime
number.
4.
Given an array A[] and a number x, check for pair in A[] with sum as x.
Eg : Input {1, 2, 4, 3, 5, 6}
SUM : 5
Output : 2 (1, 4) & (2, 3)
5.Largest Sum Contiguous Subarray
(
Kadane' Algorithm )
6.Diamond pattern : for given input size -> Here 3
*
***
*****
***
*