Answered step by step
Verified Expert Solution
Link Copied!

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 1
How to Attempt?
PANGRAM
Revisit Later
This question accounts for 50% of the total test. Please do not forget to submit your answer, timed-out tests will result in 0 points awarded.
Given a set of words St...Sw 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 -1.
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
*1<- N <=1000
*1<= length of string S; <=100
*S consists of only lowercase English letters.
INPUT SPECIFICATION
*input1:- the size of the array, N
*input2:- 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=14
*S=yz"7Cab' cd' eft'gh",j.'kl','abcd","mn","op",."qrist".uv","wx
*input3=(2,2,2,2,2,2,4,2,2,2,2,2,2,2)
Here, the minimum size subarray of S that forms a pangram sentence is
SI=
[eftgh"j'"kl,"abed","mn","op","'qr","st""'UV","wx""'yz")
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 12, the required output is 12.
Given,
*N=11
*S
-("quick" "the" "quick" (brown" "fox", "jumps" "over" "a" lazy
" dog","a")
input3= $5,3,5,5,3,5,4,1,4,3,1)
The minimum size subarray of S that forms a pangram sentence is
S
=r'the "Quick" "brown", "fox", "jumps
"'"'over"'"a" "lazy", "dog
since all the words together will contain all the alphabets at least once. This subarray is formed by all elements from the 1st index to the 9th index inclusive. Since the size of S: is 9, the output should be 9.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions