Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ public static int computeSum(int n) {
}

public static String repeatString(String s, int count) {
String result = "";
for (int i = 0; i < count; i++) {
result = result + s;
if (count <= 0) {
return "";
}
return result;
// Preserve original behavior where null becomes "null"
String unit = String.valueOf(s);
return unit.repeat(count);
}

public static List<Integer> filterEvens(List<Integer> numbers) {
Expand Down
Loading