Advanced
Refactor JavaScript Code
Improve the structure and performance of an existing function.
📝 প্রম্পট বিষয়বস্তু
Refactor the provided JavaScript function to use modern ES6+ syntax. Improve its readability by using meaningful variable names and reduce the time complexity of the algorithm.