Lesson 21 of 24

Lambdas, Custom Sorting

10 min 35 XP

Lambda എന്നത് പേരില്ലാത്ത ഒരു ചെറിയ function ആണ്: [capture](params) { body }. sort, count_if, for_each എന്നിവയ്ക്ക് സ്വന്തം നിയമം നൽകാൻ ഇത് ഉത്തമമാണ്.

Example: edit me and press Run

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.

Challenge

+35 XP

n-ഉം n വാക്കുകളും വായിക്കൂ. നീളം അനുസരിച്ച് (ചെറുത് ആദ്യം), തുല്യമെങ്കിൽ അക്ഷരമാല ക്രമത്തിൽ sort ചെയ്ത് ഓരോ വരിയിലും ഒന്ന് print ചെയ്യൂ. Input: 5 banana kiwi apple fig cherry Output: fig kiwi apple banana cherry

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.