## Question 1 What should be the output if the following string is given as input? Input string = "xyz" ### Options 1. ["xyz", "xzy", "yxz", "yzx", "zyx", "zxy"] Correct Only six valid permutations for the input string "xyz" exist. Each character of the input string can make up to two possible words. ---------------------------- 2. ["xyz", "xzy", "xxz", "yzx", "zyx", "zxz"] Incorrect ---------------------------- 3. ["xyz", "xzy", "xxz", "yzx", "zyx", "zxy"] Incorrect ---------------------------- --------------------------------------------- ## Question 2 What should be the output if the following string is given as input? (Select all possible options) Input string = "goc" ### Options 1. ["ogc", "ocg", "cog", "cgo", "goc", "gco"] Correct Six valid permutations for the input string "goc" exist. The order of the permutations does not matter. ---------------------------- 2. ["gog", "gco", "ogc", "ocg", "cog", "cgo"] Incorrect ---------------------------- 3. ["goc", "gco", "ogc", "ocg", "cog", "cgo"] Correct Six valid permutations for the input string "goc" exist. The order of the permutations does not matter. ---------------------------- --------------------------------------------- ## Question 3 How many permutations are possible for an input string of length 4? ### Options 1. 16 Incorrect ---------------------------- 2. 8 Incorrect ---------------------------- 3. 24 Correct We can calculate total number of permutations, as 4! = 24. ---------------------------- ---------------------------------------------