Click here to Skip to main content
15,904,416 members

Comments by Ayesha Madavi (Top 1 by date)

Ayesha Madavi 25-Feb-23 21:12pm View    
function VirusGuard(sectorSize, cleaningRate, virusReplicationRate) {
const infectedData = sectorSize / 1024; // convert sector size to KB
const virusSpreadTime = 2.5 * Math.log2(infectedData) / Math.log2(2.5);
const cleanedData = cleaningRate * virusSpreadTime;
const timeToClean = sectorSize / cleanedData;
return [timeToClean];
}

console.log(VirusGuard(8*1024*1024,5.12*1024*1000,2.5)); // output: [3.625]

this is the code that I generated, I can't think what Should I change