Results for “standard”
Small, practical examples. Search by task or narrow things down below.
Resolve a relative URL
Resolve a relative URL using a complete Go program with explicit sample inputs.
Go✓ Tested
Retrieve the smallest queued value first
Java: PriorityQueue poll removes the smallest value under the natural ordering.
Java✓ Tested
Return a descriptive validation error
Return a descriptive validation error using a complete Go program with explicit sample inputs.
Go✓ Tested
Return a small immutable named record
Python: Use NamedTuple when callers need both tuple behavior and named fields.
Python✓ Tested
Return a value from a loop
Return a value from a loop in a complete Rust program using the standard library.
Rust✓ Tested
Return a value from a switch expression
Java: Use an exhaustive switch expression with a fallback for other input values.
Java✓ Tested
Return multiple named values from a method
C#: Named value tuples give lightweight field names without a separate class.
C#✓ Tested
Return two values from a function
Return two values from a function using a complete Go program with explicit sample inputs.
Go✓ Tested
Reverse a string
Reverse a byte string in place with std::reverse.
C++✓ Tested
Reverse an array in place
Swap C array elements from opposite ends.
C✓ Tested
Reverse slice order
Reverse slice order using a complete Go program with explicit sample inputs.
Go✓ Tested
Round a decimal using an explicit midpoint rule
C#: Use decimal literals for decimal arithmetic and choose the midpoint rounding behavior.
C#✓ Tested