Pybites Logo Rust Platform

Reverse a String

Level: easy (score: 2)

Implement the reverse_string function that takes a string slice (&str) as input and returns a new String with the characters in reverse order.

Example

Given the input string "hello", the function should return "olleh":

let reversed = reverse_string("hello");  // "olleh"