Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 How to Attempt? PANGRAM Revisit Later This question accounts for 5 0 % of the total test. Please do not forget to submit
Question
How to Attempt?
PANGRAM
Revisit Later
This question accounts for of the total test. Please do not forget to submit your answer, timedout tests will result in points awarded.
Given a set of words StSw of size N find the subarray of S with the minimum size, that can forf a pangram sentence. Return the size of this subarray if possible, else return
NOTE
A pangram sentence is a sentence that contains every alpinabet at least once.
A subarray is a part or section of an array
CONSTRAINTS
N
length of string S;
S consists of only lowercase English letters.
INPUT SPECIFICATION
input: the size of the array, N
input: the array of strings, S
inputs: the array of lengths of strings in S
OUTPUT SPECIFICATION
output the minimum size of a subarray of S that forms a pangram sentence.
EXAMPLE
Given,
N
SyzCab cd eft'gh",jkl'abcd","mnop"qrist".uvwx
input
Here, the minimum size subarray of S that forms a pangram sentence is
SI
eftghjkl"abed","mnopqrstUVwxyz
Combining all the words in S will form a sentence that will have all the letters in the alphabet at least once. Since the size of this subarray is the required output is
Given,
N
S
quick "the" "quick" brown "fox", "jumps" "over" a lazy
dog","a
input $
The minimum size subarray of S that forms a pangram sentence is
S
r'the "Quick" "brown", "fox", "jumps
overa "lazy", "dog
since all the words together will contain all the alphabets at least once. This subarray is formed by all elements from the st index to the th index inclusive. Since the size of S: is the output should be
python code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started