Skip to content

Commit 3bc95a4

Browse files
committed
Chapter 10 - Add Missing Problem
1 parent f4bea19 commit 3bc95a4

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

chapter-10-functions.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ Here the variable **`personNames`** will get all the returns values. By calling
383383

384384
![](assets/chapter-10-images/15.Return-multiple-values-05.png)
385385

386-
## Variants of a function
386+
## Variants of a Function
387387

388388
In many programming languages, one function can be declared as **different variants** with the same name but different parameters. This is known as **method overloading**. For good or bad **JavaScript**, language doesn't support this.
389389

@@ -528,6 +528,28 @@ Define a function **`printName(name)`** and implement it. Write a function **`so
528528

529529
Test your solution here: [https://judge.softuni.org/Contests/Practice/Index/943#7](https://judge.softuni.org/Contests/Practice/Index/943#7).
530530

531+
### Problem: String Repeater
532+
533+
Create a function **`repeatString(str, count)`**, which takes parameters of type **`string`** and an integer **`n`** and returns the string, repeated **`n`** times. After this print the result on the console.
534+
535+
## Sample Input and Output
536+
537+
| Input | Output | Input | Output |
538+
| - | - | - | - |
539+
|str<br>2|strstr|roki<br>6|rokirokirokirokirokiroki|
540+
541+
## Hints and Guidelines
542+
543+
In the function below, inside the loop, append the input string to the result, that you will finally return:
544+
545+
![](/assets/chapter-10-images/21.Repeated-string-01.png)
546+
547+
Keep in mind that **in JavaScript concatenating strings in loops leads to bad performance** and is not recommended.
548+
549+
## Testing in the Judge System
550+
551+
Test your solution here: [https://judge.softuni.org/Contests/Practice/Index/943#9](https://judge.softuni.org/Contests/Practice/Index/943#9).
552+
531553
### Problem: Min Method
532554

533555
Define a function **`GetMin(int a, int b)`** and implement it, after which invoke it from the function **`solve(...)`** as shown below. To find the minimum of three numbers, first, find the minimum of the first two and then the minimum of the result and the third number:

0 commit comments

Comments
 (0)