An array ‘A’ consisting of ‘N’ integers is given. Rotation of the array means that each element is shifted right by one index, and the last element of the array is moved to the first place. For example, the rotation of array A = [3, 8, 9, 7, 6] is [6, 3, 8, 9, 7] (elements are shifted right by one index and 6 is moved to the first place).
Read MoreBinary Gap
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
In order to make code of finding out the binary gap of integer ‘N’, first of all we need to exchange from integer N to binary representation.
Read MoreImmutability and Redux
Immutable??
An immutable object is one whose content cannot be changed. An object can be immutable for various reasons, for example:
Read More