Tutte le sfide
Facile 0 risolte 0% di accettazione

Initials From a Name

Build uppercase initials from a full name.

Problema

Take the first letter of each word in full_name, uppercase it, and join the letters. Words are separated by one or more spaces.

Implement initials(full_name).

Input

full_name: A name made of letters and spaces.

Output

Return the initials, for example "ADL".

Vincoli

1 ≤ length of full_name ≤ 200; it contains at least one letter

Esempi

Esempio 1
Input:
full_name = "Ada Lovelace"

Output atteso:
expected = "AL"
Input:
std::string full_name = "Ada Lovelace";

Output atteso:
std::string expected = "AL";
Input:
string full_name = "Ada Lovelace";

Output atteso:
string expected = "AL";

Spiegazione

A from Ada and L from Lovelace: "AL".

Esempio 2
Input:
full_name = "grace  brewster  hopper"

Output atteso:
expected = "GBH"
Input:
std::string full_name = "grace  brewster  hopper";

Output atteso:
std::string expected = "GBH";
Input:
string full_name = "grace  brewster  hopper";

Output atteso:
string expected = "GBH";

Spiegazione

Extra spaces don't matter; the initials are uppercased: "GBH".

Riferimenti

Questa sfida è adattata per CodeUtility. Segui la traccia e i vincoli sopra.

Impara dagli altri

Soluzioni della community

Nessuna soluzione pubblicata. Risolvi questa sfida per condividere la prima.