Skip to content

Commit 3f8d8bb

Browse files
committed
Update challenges.md
1 parent c174faf commit 3f8d8bb

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/variables/challenges.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ void main() {
6363
}
6464
```
6565

66+
<!-- Count not figure out: https://discord.com/channels/272761734820003841/1409741482293858405/1409779369647276074-->
6667
## Challenge 4
6768

6869
Only adding lines in the middle and without writing `"A"` or `"B"` again,
@@ -90,7 +91,24 @@ void main() {
9091

9192
To be clear: you are not allowed to write `b = "A";` or `a = "B";`
9293

93-
As a hint: you can always make new variables.
94+
<details>
95+
<summary> Hint 1: </summary>
96+
<p> You can always make new variables.</p>
97+
</details>
98+
99+
<details>
100+
<summary> Hint 2: </summary>
101+
<p> What you need to do is make a "temporary variable" to hold one of the values before you swap them.</p>
102+
</details>
103+
104+
<details>
105+
<summary> Solution </summary>
106+
<p><pre>
107+
String temp = a;
108+
a = b;
109+
b = temp;
110+
</pre></p>
111+
</details>
94112

95113
## Challenge 5
96114

0 commit comments

Comments
 (0)