You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapter-09-problems-for-champions-part-2.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
# Chapter 9.2. Problem for Champions – Part II
1
+
# Chapter 9.2. Problems for Champions – Part II
2
2
3
-
In this chapter we, will review three additional problems that belong to the category "**for champions**", i.e., they are more complex than the rest of the problems in this book.
3
+
In this chapter, we will review three additional problems that belong to the category "**for champions**", i.e., they are more complex than the rest of the problems in this book.
4
4
5
-
## More complex problems on the studied material
5
+
## More Complex Problems on The Studied Material
6
6
7
7
Before moving on to particular problems, we must clarify that we can solve them more efficiently with **additional knowledge in programming with Java** (methods, arrays, collections, recursion, etc.). Each solution that we will provide now only uses the material covered in this book. The goal is to learn how to construct **more complex algorithms** based on your knowledge up to the present moment.
8
8
@@ -69,7 +69,7 @@ Let's examine each of the parts in detail.
69
69
70
70
The input of our problem consists of a few components:
71
71
- On the **first line, we have all the money** that Lina has for shopping.
72
-
- On **each of the following lines**, we will have kind of**command**.
72
+
- On **each of the following lines**, we will have a**command**.
73
73
74
74
The first part of the reading is trivial. We should keep in mind that we will be using the **`BigDecimal`** type because we are working with money, and we need precise accuracy:
75
75
@@ -91,7 +91,7 @@ The algorithm for solving the problem is a direct one – we continue **reading
91
91
92
92
Let's examine the first two sub-problems for our algorithm. The first sub-problem concerns the way we read the commands until we reach the **"mall.Exit"** command. The solution that we previously saw uses a **`while-loop`**. The second sub-problem is to **access each symbol** of the command passed. Keeping in mind that the input data with the commands is a **`String`** type, the easiest way to access each symbol inside the strings is via a **`foreach` loop**.
93
93
94
-
Here is how the code will look like when are using those two types of loops:
94
+
Here is what the code will look like when are using those two types of loops:
@@ -133,7 +133,7 @@ How can we do that? We will leave the answer to this question to the reader.
133
133
Test your solution here: [https://judge.softuni.org/Contests/Practice/Index/664#0](https://judge.softuni.org/Contests/Practice/Index/664#0).
134
134
135
135
136
-
### Problem: Numerical Expression
136
+
### Problem: X Expression
137
137
138
138
Bonny is an extremely powerful witch. Because her natural power is not sufficient to successfully fight vampires and werewolves, she has started to master the power of Expressions. An expression is hard to master because the spell relies on the ability to **quickly solve mathematical expressions**.
0 commit comments