Problem Statement
What is the syntax for a lambda expression in Kotlin?
Explanation
Kotlin lambda expressions are enclosed in curly braces with parameters before the arrow and the body after, like val sum equals open curly x comma y arrow x plus y close curly. If the lambda has a single parameter, you can use the implicit it variable instead of declaring the parameter name.
Lambdas can capture variables from their surrounding scope, and if a lambda is the last parameter of a function call, it can be placed outside the parentheses for better readability. This syntax is concise and integrates seamlessly with Kotlin's higher-order functions.
