Retired

Browser tabs (retired)

Description:

Introduction
How often do you use a large number of tabs in bowser? The main character of this kata is Bob, and he often has problems with RAM overflow due to the large number of tabs. Bob already knows how much memory each tab needs and how much RAM space he has. Bob wants to know if he opens several tabs, will he have enough RAM space? Can you help him?

Task
Write a function that takes an array of tab sizes in the format "{size}{unit}", as well as the amount of free space on RAM and returns whether these tabs will fit on Bob's RAM

Examples

["1Kb", "10Kb", "5Kb"], "16Kb" -> True
["32Mb"], "32Kb" -> False
["32Kb"], "32Mb" -> True
["1000b"], "1Kb" -> True
["1000b", "1b"], "1Kb" -> False
["1Mb", "1000Kb", "1000000b"], "3Mb" -> True
["100Mb"]*10 + ["1b"], "1Gb" -> False
["1000Gb"], "1Tb" -> True

Untils
Should work with bits, kilobits, megabits, gigabits and terrabits. Use formal values for this kata:
1Kb -> 1000b
1Mb -> 1000Kb
1Gb -> 1000Mb
1Tb -> 1000Gb

Logic

Similar Kata:

Stats:

CreatedJan 31, 2023
Warriors Trained27
Total Skips0
Total Code Submissions155
Total Times Completed23
Python Completions23
Total Stars1
% of votes with a positive feedback rating66% of 16
Total "Very Satisfied" Votes7
Total "Somewhat Satisfied" Votes7
Total "Not Satisfied" Votes2
Total Rank Assessments17
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • MeeDaniel Avatar
Ad