57. Reverse a string
Write reverseString s, which returns the characters of s in reverse order.
Characters are Unicode characters, not bytes: "λx" reverses to "xλ".
Examples
Input: reverseString "hello"Output: "olleh"Input: reverseString "Lean"Output: "naeL"Input: reverseString ""Output: ""
Submitting also runs 5 hidden tests.
Loading editor…
Type
\to in the editor, or click:Run checks your code against the examples and your custom inputs and records nothing. Submit also runs the hidden tests, confirms the axioms your proof uses and records the result. Each uses one compiler check.
ReadyLn 1, Col 1Lean 4
Draft saved in this browser