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 1.
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 =2,j sFiles =1, and readMeFiles =2.
The number of files in each folder cannot exceed capacity =2. In
this case, you would need a minimum of 3 folders. One possible
solution is such: 1 CSS file and 1 README file, 1 CSS file and 1
README file, and 1 JS file. Therefore, the answer is 3.
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 parameter(s):
cssFiles: an integer
jsFiles: an integer
readMeFiles: an integer
capacity: an integer
Constraints
Folder Organization A web development project is

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!