You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a video size, a unit for the video size, a hard drive capacity, and a unit for the hard drive, return the number of videos the hard drive can store using the following constraints:
4
+
5
+
The unit for the video size can be bytes ("B"), kilobytes ("KB"), megabytes ("MB"), or gigabytes ("GB").
6
+
If not given one of the video units above, return "Invalid video unit".
7
+
The unit of the hard drive capacity can be gigabytes ("GB") or terabytes ("TB").
8
+
If not given one of the hard drive units above, return "Invalid drive unit".
9
+
Return the number of whole videos the drive can fit.
10
+
Use the following conversions:
11
+
Unit Equivalent
12
+
1 B 1 B
13
+
1 KB 1000 B
14
+
1 MB 1000 KB
15
+
1 GB 1000 MB
16
+
1 TB 1000 GB
17
+
For example, given 500, "MB", 100, and "GB as arguments, determine how many 500 MB videos can fit on a 100 GB hard drive.
0 commit comments