PALINREP - Editorial

PROBLEM LINK:

Practice

Contest

Author: Akshay Venkataramani

Tester: Timothy

DIFFICULTY:

CAKEWALK

EXPLANATION:

All palindromes of length greater than 1 have characters that are repeated more than once. Hence, for all n > 1 the answer is -1. For n=1, the lexicographically smallest string of length 1 is ‘a’.

AUTHOR’S SOLUTION:

Author’s solution can be found here.