Article type: {{ thisQuesInfo.pageType.substr(0, 1).toUpperCase() + thisQuesInfo.pageType.substr(1) }} {{ thisQuesInfo.Title }}{{ thisQuesInfo.Author }} published this on {{ thisQuesInfo.Date.replace(/-/g, '/') }} Comments ({{ bestVotes.length }}){{ comment.value }} {{ comment.thisAnsInfoAuthor }} commented on {{ comment.thisAnsInfoDate }} Leave a commentLog in to submit a comment. The program should work as follow:
My code doesn't do the same. I think there is should be the 2nd loop, but I don't really understand how can I do it. Could you possibly give me a hint or advice to solve this task. Thanks. My code looks like this:
asked Nov 1, 2021 at 19:45
2 This should work:
answered Nov 1, 2021 at 19:57
Chris JChris J 1,3758 silver badges19 bronze badges 2
answered Nov 1, 2021 at 20:10
MaratMarat 14.1k2 gold badges37 silver badges45 bronze badges 1 Not the most space-efficient way, but if the number is relatively small, an easy approach is to build a list and just pop off either end in turn:
answered Nov 1, 2021 at 19:56
SamwiseSamwise 58k3 gold badges29 silver badges38 bronze badges 2 Seemingly the most memory efficient way would be to use
answered Nov 1, 2021 at 20:00
MatiissMatiiss 5,6562 gold badges12 silver badges27 bronze badges This is a cute way to do it:
answered Nov 1, 2021 at 20:15
Jon KiparskyJon Kiparsky 7,2212 gold badges22 silver badges38 bronze badges
answered Apr 30 at 15:36
1 |