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.