We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #24: Lexicographic permutations

Project Euler #24: Lexicographic permutations

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 24 from projecteuler.net

A permutation is an ordered arrangement of objects. For example, is one possible permutation of the word . If all of the permutations are listed alphabetically, we call it lexicographic order. The lexicographic permutations of are:

What is the lexicographic permutation of the word ?

Input Format

The first line contains an integer , i.e., number of test cases.
Next lines will contain an integer .

Constraints


Output Format

Print the values corresponding to each test case.

Sample Input

2
1
2

Sample Output

abcdefghijklm
abcdefghijkml

Author

shashank21j

Difficulty

Easy

Max Score

100

Submitted By

3561

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits

Choose a translation


  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature