समस्या
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".
सीमाएँ
1 ≤ length of full_name ≤ 200; it contains at least one letter
उदाहरण
इनपुट:
full_name = "Ada Lovelace"
अपेक्षित आउटपुट:
expected = "AL"
इनपुट:
std::string full_name = "Ada Lovelace";
अपेक्षित आउटपुट:
std::string expected = "AL";
इनपुट:
string full_name = "Ada Lovelace";
अपेक्षित आउटपुट:
string expected = "AL";
व्याख्या
A from Ada and L from Lovelace: "AL".
इनपुट:
full_name = "grace brewster hopper"
अपेक्षित आउटपुट:
expected = "GBH"
इनपुट:
std::string full_name = "grace brewster hopper";
अपेक्षित आउटपुट:
std::string expected = "GBH";
इनपुट:
string full_name = "grace brewster hopper";
अपेक्षित आउटपुट:
string expected = "GBH";
व्याख्या
Extra spaces don't matter; the initials are uppercased: "GBH".
संदर्भ
यह चुनौती CodeUtility के लिए अनुकूलित की गई है। ऊपर दिए गए स्टेटमेंट और सीमाओं का पालन करें।