Question: 11 Problem statement: Rocky is a software engineer and he is creating his own operating system called myFirst os. myFirst os is a GUI (Graphical
11 Problem statement: Rocky is a software engineer and he is creating his own operating system called "myFirst os". myFirst os is a GUI (Graphical user interface) based operating system where everything is stored in files and folders. He is facing issues on creating unique folder names for the operating system. Help rocky to create the unique folder name for it's os.If folder name already exists in the system and integer number is added at the name to make it unique. The integer added starts with 1 and is incremented by 1 for each new request of an existing folder name. Given a list of folder names, process all requests and return an array of corresponding folder names. W n=5 foldername= ['home', 'myfirst' ,downloads', 'myfirst', 'myfirst] Foldername[0] = 'home' is unique. Foldername[1] = 'myfirst' is unique. foldername [2] ='downloads' is unique. Foldername[3] = 'myfirst' already exists in our system. So Add1 at the end of the folder name i.e foldername[3] ="myfirst1" . Folder
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
