String Pair Codevita 9 Solution

Page Contents

String Pair Codevita 9 Solution

 

One individual hands over the rundown of digits to Mr. String, But Mr. String sees just strings. Inside strings additionally he sees just vowels. Mr. String needs your assistance to locate the absolute number of sets which signify a specific digit D. 

 

The principles to ascertain digit D are as follow 

 

Take all digits and convert them into their printed portrayal 

 

Next, summarize the quantity of vowels for example {a, e, I, o, u} from all literary portrayal 

 

This aggregate is digit D 

 

Presently, when digit D is realized discover all unordered sets of numbers in input whose aggregate is equivalent to D. Allude model segment for better understanding. 

 

Imperatives 

 

1 <= N <= 100 

 

1 <= estimation of every component in second line of info <= 100 

 

Number 100, if and when it shows up in info ought to be changed over to printed portrayal as hundred and not as 100. Henceforth number of vowels in number 100 ought to be 2 and not 4 

 

Info 

 

First line contains a number N which speaks to number of components to be prepared as info 

 

Second line contains N numbers isolated by space 

 

Yield 

 

Lower case portrayal of printed portrayal of number of sets in input that summarize to digit D 

 

Note: – (If the check surpasses 100 print “more prominent 100”) 

 

Time Limit 

 

 

Models 

 

Model 1 

 

Information 

 

 

1 2 3 4 5 

 

Yield 

 

one 

 

Clarification 

 

1 – > one – > o, e 

 

2 – > two – > o 

 

3 – > three – > e, e 

 

4 – > four – > o, u 

 

5 – > five – > I, e 

 

In this manner, include of vowels in printed portrayal of numbers in input = {2 + 1 + 2 + 2 + 2} = 9. Number 9 is the digit D alluded to in area above. 

 

Presently from given rundown of number {1,2,3,4,5} – > discover all combines that summarize to 9. 

 

After handling this we realize that lone a solitary unordered pair {4, 5} summarize to 9. Consequently the appropriate response is 1. Nonetheless, yield determination expects you to print literary portrayal of number 1 which is one. Thus yield is one. 

 

Note: – Pairs {4, 5} or {5, 4} both summarize to 9. In any case, since we are requesting to tally just unordered pair, the quantity of unordered pair is this mix is just one. 

 

Model 2 

 

Info 

 

 

7 4 2 

 

Yield 

 

zero 

 

Clarification 

 

7 – > seven – > e, e 

 

4 – > four – > o, u 

 

2 – > two – > o 

 

Along these lines, include of vowels in literary portrayal of numbers in input = {2 + 2 + 1} = 5. Number 5 is the digit D alluded to in area above. 

 

Since no sets signify 5, the appropriate response is 0. Literary portrayal of 0 is zero. Subsequently yield is zero.

Codevita Season 9 All Questions Solutions

Listed Here :

Leave a Comment

close
error: Content is protected !!