Given an array of N integers, find the pair of integers in the array which have minimum XOR value. Report the minimum XOR value.
XOR
Examples : Input 0 2 5 7 Output 2 (0 XOR 2)…
You are given an array of N integers, A1, A2,…, AN. Return maximum value of f(i, j) for all 1 ≤ i, j ≤ N.f(i, j) is defined as, |A[i] - A[j]| + |i…
f(i, j)
|A[i] - A[j]| + |i
Monk’s favourite game is Football and his favourite club is “Manchester United”. Manchester United has qualified for the Champions League Final which is to be held…
Given a string S, count the number of non empty sub strings that are palindromes.A sub string is any continuous sequence of characters in the string.A string is said to be palindrome, if the…
You are given a string S. S consists of several words separated by one or more spaces. Word consists of Latin letters as well as other symbols (but not spaces).In each word which starts from lowercase Latin letter replace starting letter with uppercase Latin letter.
You have a string,s, of lowercase English alphabetic letters. You can perform two types of operations on s:
Leonardo thinks 4 and 7 are lucky digits! He defines a number as lucky if it can be represented as the sum of one or more of these lucky digits. For example, he considers the following numbers to be…
Alice is celebrating the New Year with n piles of candies! Each pile i contains ci candies, and she defines her happiness factor as the minimum number of candies in any pile. As this is a special day, Alice wants to try to maximize her happiness factor by…
Nikhil learnt two new commands pwd and cd on the first day of Operating Systems lab.
In code world all genders are considered equal ( It means their is nothing like male or female). Now their are N distinct persons living in this hypothetical…