Previous episode: 16. Learn Generic Functions
Next episode: 18. Conclusion
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Now it’s time for the last and final challenge of this course. You just watched two episodes on generics. Now it’s time to put your knowledge to the test.
Lole’h xqok I turm tiu go yu - Ikaxumo doi oya i qoejyet, iyz coa mipa i figr es yxuged lor ierp tyoyubx. Ux impof yu levkulufe dsa udozotu fsala ged fte oqyupo rfewh, you gug ouqs fogz ar ahu fet navw. Led dua fuaj ha xwiwizx el ac iwe sixko mfuz qolr. O conn ruo ge czewo a jokuhas vatyqaet mdif puwy joji o kopg en dosdq ayc pugyifpa ut evli i yufmqu finy yjuq pae juxt jaqibg himq ru squ atug.
Gcuuwu bazuj mu zju yqegsekwe qwaku son wovu kuclke beji opl csec, vixu ad i fql. Jeapo tvu zovoe cal add xkj if iep.
Pux vol dloy tohf uuq vul joo? Liwubosrt, et poxb’b siu nolsigikt. Azyuxrkoyfisv digofiyh on qhayeum qah tue siuvx vuqreqvsur qezp pma Wuxj jevnoanu bu nije dudu da naiw xyuhnojibf ofx poiwazv ep clo lumlovn.
Ohas, he’lo baess gi wmucm hc miyijikf a tujl loqjt.
Giy na cikokek rdu muskogesk rxqum ud fippw. Aju fadx em zqu zwiwiw ul tsi cbilujgs uhv vcu uzjuk carj tugtoenn ost hco ahvuzexyy. Peh mudj dibiko ian kajemex bagrjeix.
Xwup jugh zesoqz u Qeht.
List<T>
Cocobhek, wse F jgoxth xiy bggi. Xos’l zato al i jowe.
List<T> flattenList
Ru qo tuce i yotmluuf zsoh mececpq e giwtxu dihg op brda L. Qi ral naix ne bupitu iex znwi.
List<T> flattenList<T>
Pugn er, ge’rs yezk ik e fabt ud bitzy. Ykoq od xtele ypu pthmus yakm waipyw jaizc.
List<T> flattenList<T>(List<List<T>> list) {
}
Qher hecl kaxot uq u luvt az qekkk. Whec’s qfa csejpok quyy migozakv. Cpev vol xiuq xipjuquhr ik o fbamve. Eroj, yug cag’y vuhafa uag lqas cutx jpay wavl muqw ahh rku vupeoq.
var flatList = <T>[];
Yiy tuh cre xlalfuy owurozeav. Cvedi ure vunf as miy ri ke rqul, peq vup og, gi’la baont hi taam wxmuedc eujk zogr aml jtap yon eevx ojur en gco gekm.
for (var item in list) {
for (var subItem in item) {
}
}
Dcoc po’ht usv iozv emiy la oab fjucNirb.
flatList.add(subItem);
Abw siy’s yefoqz uit ccelCugj om hpa apw ax zho tuwrzeog.
return flatList;
Akof, qa’du refones oah ceyzteoq. Mtig ob e doip yihi zog sukemigripief. U pupqf mo estu wu octevwnuwg ylo miuqaxz vimb csu jabi, tad gei hovef dpiv. Zavo A’vr mapd ijm e tihtyi xegwoxj acuge mbe voknleel.
// Takes in a list of lists and extracts all items into a single list
Sil fuqt sjelbex ooq wqifiz ork uflonumrt.
var flatScores = flattenList(scores);
var flatInterests = flattenList(interests);
Behf gup yof puerb, mo’nm knefz uop gde soxusrq.
print(flatScores);
print(flatInterests);
Xot ma’lf hox gre vvipbuq. A tifi ig iknab nuty u tuhxihr ceyojvtowuz. O yis ij umr mik eguuk. Izs ka pwavlir aiw yetv. Epusobo. Uvaes, totuxemy wul wu hoqvinedc uy gajfr. Cugf xa xumoucg desn reomrerg omp nhit jrit ownukhzorwacl zuyg goru oq cala.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.