Z3/Z3Clarifications

From ZCubes Wiki
Revision as of 01:16, 30 August 2016 by Jayaram (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Z3 Clarifications

Clarifications on Z3


Q 24. In how many different ways can the letters of the word 'CORPORATION' be arranged so that the vowels always come together?

How do we get a subset of a string value without using loop

Ans:
word = "CORPORATION";
vowels ="AEIOU";
vowelsarray=vowels.split("");
wordletterswithoutvowels=word.split("").filter((x)=>!x.isin(vowelsarray)); 
OR
IsNotAVowel:=!x.isin(vowelsarray);
word.split("").filter(IsNotAVowel);
OR
IsNotAVowel:=!x.isin("AEIOU".split(""));
word.split("").filter(IsNotAVowel);
Result => CRPRTN