Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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)
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. Example n=5 foldername= ['home', 'myfirst","downloads', 'myfirst', 'myfirst] Foldername[0] = 'home' is unique. Foldername[1] = 'myfirst' is unique. foldername [2] ='downloads' is unique. Foldemame[3] = 'myfirst' already exists in our system. So Add1 at the end of the folder name i.e foldername[3] ="myfirst1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started