Lapindromes Codechef Solution

Lapindrome is defined as a string which when split in the middle, gives two halves having the same characters and same frequency of each character. If there are odd number of characters in the string, we ignore the middle character and check for lapindrome. For example gaga is a lapindrome, since the two halves ga and ga have the same characters …

Lapindromes Codechef Solution Read More »

The Smallest Pair Codechef Solution

You are given a sequence a1, a2, …, aN. Find the smallest possible value of ai + aj, where 1 ≤ i < j ≤ N. Input The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.  The first line of each description consists of a single integer N. …

The Smallest Pair Codechef Solution Read More »