Recently updated blogs
- Huawei od 2023 | What is Huawei od, od salary, od machine test questions list
- A collection of Huawei OD computer test questions, use Python to solve Huawei computer test questions | Computer test guide
- [Huawei OD computer test] Full process analysis + experience sharing, question type sharing, anti-cheating guide
- Huawei OD computer test, exclusively compiled the practical skills of those who have participated in the computer test
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