public/subjects/arrange_it
davhojt 5f935e29a8 docs: implement Miguel's feedback 2022-05-23 20:46:23 +03:00
..
README.md docs: implement Miguel's feedback 2022-05-23 20:46:23 +03:00

README.md

arrange_it

Instructions

Create a function named arrange_phrase, that takes a string literal, sorts the words and returns it. Each word will contain a number that indicates the position of that word.

Expected Functions

pub fn arrange_phrase(phrase: &str) -> String {
}

Your heap allocations will be monitored to ensure that you do not make too many allocations, and that your allocations are reasonably sized.

Usage

Here is a program to test your function

use arrange_it::*;

fn main() {
    println!("{:?}", arrange_phrase("is2 Thi1s T4est 3a"));
}

And its output

$ cargo run
"This is a Test"
$

Notions