Asked inNutanix,Mts1

Lexicographic Permutation Rank Problem Statement

Given a distinct string, determine the lexicographic permutation rank of the string.

Example:

Input:
T = 2
S = "abc"
S = "bac"
Output:
1
2
Explanation:

For the first test case, "abc" is already the smallest permutation hence rank 1. In the second, "bac" is the second permutation in lexicographic order, hence rank 2.

Constraints:

  • 1 <= T <= 25
  • 1 <= |S| <= 20
  • 'a' <= S[i] <= 'z'

Note: Implement the function to solve the problem, no need to handle input/output.

AnswerBot
4mo

The problem involves determining the lexicographic permutation rank of a distinct string.

  • Iterate through all permutations of the string and compare with the given string to determine the rank.

  • Use a re...read more

Help your peers!
Select
Add answer anonymously...

Nutanix Mts1 interview questions & answers

A Mts1 was asked Q. Ninja and Stack of Boxes Problem Help Ninja to create the tallest stack possible...read more
A Mts1 was asked Q. Split the String Problem Statement You are given a string str consisting of N lo...read more
A Mts1 was asked Q. Lexicographic Permutation Rank Problem Statement Given a distinct string, determ...read more

Popular interview questions of Mts1

A Mts1 was asked Q1. Ninja and Stack of Boxes Problem Help Ninja to create the tallest stack possible...read more
A Mts1 was asked Q2. Split the String Problem Statement You are given a string str consisting of N lo...read more
A Mts1 was asked Q3. Lexicographic Permutation Rank Problem Statement Given a distinct string, determ...read more
Nutanix Mts1 Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits