Question: Folder Organization A web development project is being organized into several folders, and there are three rules that need to be followed: Only one README
Folder Organization
A web development project is being organized into several folders,
and there are three rules that need to be followed:
Only one README file is allowed in each folder, and it cannot be
the only file in the folder.
The number of CSS files and JS files can only exceed the number of
the other file type by at most
Only a certain number of files are allowed in each folder.
Given the types of files and the folder capacity, what is the
minimum number of folders needed to organize the project?
For example, let's say cssFiles sFiles and readMeFiles
The number of files in each folder cannot exceed capacity In
this case, you would need a minimum of folders. One possible
solution is such: CSS file and README file, CSS file and
README file, and JS file. Therefore, the answer is
Note: It is guaranteed that the answer always exists.
Function Description
Complete the function minFolders in the editor below. The
function must return an integer denoting the minimum number of
folders required to organize the project.
minFolders has the following parameters:
cssFiles: an integer
jsFiles: an integer
readMeFiles: an integer
capacity: an integer
Constraints
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
