1. सीखें
  2. /
  3. पाठ्यक्रम
  4. /
  5. Optimizing Code in Java

Connected

अभ्यास

Implementing memory-efficient string processing

You're developing a text processing application that needs to pre-populate an array with the same string value multiple times. The current implementation creates a new String object in each loop iteration, which is inefficient for large arrays. Your task is to implement a more efficient version of this method.

निर्देश

100 XP
  • Reuse the provided value to add to the list.
  • Return the final array.