Skip to content

Commit 6cc9d60

Browse files
jonaslattgonzalobg
authored andcommitted
JSon errors corrected.
1 parent afb6421 commit 6cc9d60

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

labs/lab1_select/select.ipynb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,23 @@
6464
"A first version of `select` is provided, which looks as follows:\n",
6565
"\n",
6666
"```c++\n",
67-
"template<class UnaryPredicate>
67+
"template<class UnaryPredicate>\n",
6868
"std::vector<int> select(const std::vector<int>& v, UnaryPredicate pred)\n",
6969
"{\n",
70-
" // TODO Instead of the line below, create a vector w and use a "copy_if" algorithm\n",
70+
" // TODO Instead of the line below, create a vector w and use a \"copy_if\" algorithm\n",
7171
" // call to copy all elements from v to w that are selected by the unary predicate.\n",
7272
" auto w = v;\n",
7373
" return w;\n",
7474
"}\n",
7575
"```\n",
7676
"\n",
77-
"[exercise0.cpp]: ./exercise0.cpp"
77+
"[exercise0.cpp]: ./exercise0.cpp\n",
7878
"\n",
7979
"The example compiles and runs as provided, but it produces incorrect results due to the erroneous `select` implementation.\n",
8080
"Replace the erroneous line by an appropriate call to the `copy_if` algorithm.\n",
8181
"Hint: You can't allocate the right number of elements for `w` in advance, because you don't know how many elements the `copy_if` algorithm is going to copy. Instead, use `std::back_inserter` to create an iterator which inserts elements at the back of `w` and resizes the vector appropriately as the algorithm progresses.\n",
82-
"Once you fix the code, the following block should compile and run correctly:\n"
83-
"\n",
82+
"Once you fix the code, the following block should compile and run correctly:\n",
83+
"\n"
8484
]
8585
},
8686
{
@@ -188,8 +188,8 @@
188188
"\n",
189189
"Once the code is completed, the following blocks should complete properly and produce the same output as in exercise 0.\n",
190190
"\n",
191-
"[exercise1.cpp]: ./exercise1.cpp"
192-
"\n",
191+
"[exercise1.cpp]: ./exercise1.cpp\n",
192+
"\n"
193193
]
194194
},
195195
{
@@ -294,8 +294,8 @@
294294
"\n",
295295
"Once the code is completed, the following blocks should complete properly and produce the same output as in exercise 0 and exercise 1.\n",
296296
"\n",
297-
"[exercise2.cpp]: ./exercise2.cpp"
298-
"\n",
297+
"[exercise2.cpp]: ./exercise2.cpp\n",
298+
"\n"
299299
]
300300
},
301301
{
@@ -388,7 +388,7 @@
388388
"!dpcpp -std=c++20 -Ofast -DNDEBUG -isystem/usr/local/range-v3/include -o select solutions/exercise2.cpp\n",
389389
"!./select 30"
390390
]
391-
},
391+
}
392392
],
393393
"metadata": {
394394
"kernelspec": {

0 commit comments

Comments
 (0)