Question: KING - DREAMS - I Once upon a time, a King saw a dream, where if his kingdom has food line of tanks. meaning tanks
KINGDREAMSI
Once upon a time, a King saw a dream, where if his kingdom has food line of tanks. meaning tanks lined up side by side in a certain way, they will become invincible.
Now, since you are the advior of the king, he has asked you to create a good line of tanks.
There are types of tanks, numbered i through and we have infinite amount of tanks for each type.
Come up with a good line of size tanks. If there are multiple good line return one which is lexographically smallest.
good tine is a configuration where tanks lined up in an array and the count of subarrays with only distinct tank types is maximum. eg contains subarrays with distinct tanks:
An array is lexicographically smaller than an array if there exists an index i such that and for all
Constraints
Input Format
The only line contain space seperated integer values and where the size good line the number types
Output Format
Return a list size
Sample Input
Example
Input:
Output: Less formally, the first index which they differ,
Constraints
Input Format
The only line contain space seperated integer values and where the size good line the number types
Output Format
Return a list size
Sample Input
Example
Input:
Output:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
