==== Self check 2 in four steps ==== The folowing self check is not graded. It serves as an evaluation of your current programming skills. Self check is a compulsory part of the PGE course. \\ Work out the self-check **individually**, without asistance of other persons. \\ **Step 1.** Write function ff with one string parameter S1. The function returns another string S2 which is a modification of string S1. The modification is described below. **Step 2.** Copy the string ExampleS1 given below into your code. Pass ExampleS1 as the parameter to ff. Call ff with the given parameter ExampleS1 and store the return value in a string variable Result. **Step 3.** Print the substring consisting of the eight middle characters in variable Result. The substring should be "i8AU9CA5". **Step 4. Report ** Write an e-mail to PGE teacher [[mailto:berezovs@fel.cvut.cz| Marko Berezovsky (berezovs@fel.cvut.cz) ]]. \\ * In the e-mail, specify the approximate time you spent on the self check. * Also, describe any difficulties if you have encountered them while preforming the self check. * If you experienced no difficulties, mention it in the email. * Include the code of function ff in your e-mail. * Send the report, preferably, before 12.4. **Thank you for your cooperation!** ==== Modification ==== String S1 contains some number of unempty substrings, say N, which are enclosed in square brackets. Also, string S1 contains exactly N other unempty substrings which are enclosed in round brackets. For the sake of simplicity, let us call the substrings in the square brackets "square substrings" and the substrings in the round brackets "round substrings." String S2 is constructed from S1 in such way that the first square substring is substituted by the first first round substring and the first round substring is substituted by the first first square substring. In other words, those two substrings are swapped. Then the same holds for the second square substring and the second round substring. They are swapped in S2. Then, the same holds for all remaining square and round substrings, third square substring is swapped with third round substring, fourth square substring is swapped with fourth round substring, and so on. All characters which are not part of the square or round substrings are not swapped, that remain in their relative position. It is guaranteed that no two square or round substring over lap, even partially. Example: S1 = "--[aaa]---[bb]---(AAAA)=[cc]=(BBB)----(CCCC)==" S2 = "--[AAAA]---[BBB]---(aaa)=[CCCC]=(bb)----(cc)==" S1 = "a(333)bcde(55555)fghi[threes]jklmn[fives]opqrs" S2 = "a(threes)bcde(fives)fghi[333]jklmn[55555]opqrs" S1 = "(ab)?[CDEF]??????[gh]??(ijkl)?" S2 = "(CDEF)?[ab]??????[ijkl]??(gh)?" \\ ==== Data ==== ExampleS1 = "y8L251p(boFO08INKAoEdO1Io87)iD0F2[k]70J[oO41es523i]08jISP9e4[9U4Y4i41O]L4Il9YC362OoE8IEoA(P1U3g0y4yu118Yov6)oFIM61E7a6ucy29oa7lo[5269AT45acg12]6112Muo2djsGiOo444o[OseG9]5iAUU3aoE8N[U1o23iY29Un0O922]eA0I[Ulvuo89NDuo34r88]i341OO8(a7ko5y)a9PAEp(jeT3Y7118OV8)9oE076W7Aud4O33yD1(EW6v026l15ICiSiy)u13[6uuUiY620oi3i32aS60]E8J2e1Ya(0HPEU0T7H0o8mo6E)n14U(uocOieo48439u)U(UL5)E3A33(y10ES)u0ni185c5UuJU(o)8EoRE33da8aUY5978Y3u[4iu7O4u2eMt]o44GKUPA(ProuY75JU7s1U8So)54vU6leB(Fl46oOn6F5W3)yEv96k8EA125S(K9F)81uoIY[n5ay29eFA492v]EYda7IO8i[0YL4rO7IOuiVr51OEo5]s2od6DIun6I2o34Yv[Obo25aM]U94ok3[8o3A2E6uoOJ6Wi]4E1ou9[vaOEokO5O]ioaYj0SUY8vM(aH2JaUuUvOUTC)52Ou9E5UpAp1OF9AC[iu649O82Icn2DAIYA2BA]u8oYA6U35On0YNH5oE5[154mm5]kOyRyyYE00o[J3FDAS0Yi0u6]9vScB7CN4W1k7v5U1LA(IHUd0eo2423T)Y1RiuiOyU[4i935uK7a69To]2mo6uvWYu9[uo1tB4923AN6]E4nuy52AoIeovO5A4J[oOe8iD66sr20c3OS]lu0j5WIUuAyK(2)OpiUo9Y[oc3]2m6Aeo4Ad4OoOU(8vk)emu28vUaD049(u3H)152W2P86Yj63M(2EeU8sO4IMEE)2jU1W9C302N91aVO81O(n24G5F8)ItOIe0ouHBMTe[62uacKHYi8AU9CA5u8oK]77oI4cA41N[7ui9eE25nYesoa5OA15Y]a8LTd8YoI[oN3ItylA46AIDUiDoe]yiik1E5Oeo[nr1YOP8i5Y960Hu]053bUYyFaI0Lbo(0061e1904FRo)3eEY43Joaoe25r381[t7IRib2aNYYa4pOp0o]3[Y9M41oo1EiO]EI818gAaFyeY7U[4O6uIy8]U0YI069W[p8iUeE5sIOu0rD8416]F5OasF8S7UIUU7UrHd[3I7BMejyU8En4]o0s5[Io1J498uI]0U96I05MkyO2yI(9F6R602R71FM)sgUI8yU1(VNbit23oUeYo4P2)oeoe20u89oGoPT(l5)jk99iGo(5NUA0olAgFoO)iiA9OYp18gU0yEI9EGuW(5L2O3YDPu2Ygio3IukAi)dMNO4[IFi5Hoe3u0iO]uTo7Cic[Vk9]K419OU83y7HO[I5uu9HaUMya2YF5I]3U703AM7IL9Ue210[o]uuABy4o1SyYp2150(o1M1IouBN)61mao2oa22sED(oC10iI9398IU5025Wv)IIASN2lu[97ePoOV6]460IY4Ii4WaA868teI[UW60UU3V9G]rUY[8ur6rAONUi]O7oEe82(68o4OId8Cg7E9ye)1Og[OE9riHcu611PEEo45]guo6(c6V310IY6g4O82o4)203oAYUIOyijkeA504(rv1c4A2s1i)3331EMOyv862[y]Oive2Og6(pO68G89V7OoO2e9iu9)u0dOoid1iAUci[6oJp6yjOPO]Ymo2rCAVm6ot[EEUOE9g3o2I04Y42]uU2B2LeYV2AbeC9UoAaP(kaou4s9UAir6S1u)tO6nEAt2oAeV8oua1U(aoaeAIca5Y3CAN31aHsu)2IUvijd(6uAAA3282j158oO18GOT)1[u8ivOy8U07OIn3]05Y4cUioUINO8(I0ea8UDU2EoE)CI1uAaEgk(i3O218)Ue24I6(1YB348)y64g3TOY4M6OHO28403(SDa1uuHi)789OB0(7pHo0A120156Uai)ap5LCLoELAk3uO9(AOYiuK41u1oOY1)yaEjU9uEu85uoi(dio56j8O195)bu[D35l48i5a22834d]EP5kAr(96UAooCoi)83BoI1O[s9t]g2O2OE97Iy(A5yec3aSJtU0y)1jO2o61II60aF2Iv1Ao4(65udO51EcoD)u(yGUAUdL5FuOnIOY2RoS0)e7656DEDe2IHui[I8tl32O4EoAo07EJTFEY]4REl4y067[a5i5NoO4O]oyYu4GuAUJY6J8EBA2YC[sLupYIIO4AES1I1m]I48O3oI6bUYD1IB7V[EUULuCo7yNYE9]uIioFb(3I69Bi1I5UYyOto2ym)05U3oOB2(4L4eioU3Y52o37Eou3yA)E5OpEbd0aIYDeAoEOo0(IO9Ivc9eeCS22pJ4I8)IO439TSOy18481ONO14(3uUD2I88eUu)IE26(UIa8675oI8DI)10u[MIONi45]ooyo73o8I[oY92NYE1aiTeAU8vO]WY8v8O5a3eu97"