[2023Q2 first OD computer test candidates’ winning questions] Blockchain file dump system, coded with JS, speed pass

[2023Q2 first OD computer test candidates’ winning questions] Letter combination, coded with JS, speed pass

Recently updated blogs

Solution to this Huawei OD machine test question: Blockchain file dump system

Question description

The underlying storage of the blockchain is a chain file system, consisting of N files in sequence, each file has a different size, in order F1​, F2​…Fn​. As time goes by, the storage occupied will become larger and larger.
The cloud platform considers dumping the blockchain to a cheap SATA disk by file. Only continuous blockchain files can be dumped to the SATA disk, and the sum of the dumped files cannot exceed the capacity of the SATA disk.
Assume that the capacity of each SATA disk is M, find the sum of the maximum continuous file sizes that can be dumped

Guess you like

Origin blog.csdn.net/hihell/article/details/130590521