0% found this document useful (0 votes)
50 views2 pages

Strings 2 Assignment.

The document provides instructions for string manipulation problems in C++. It includes: 1) Concatenating a string with its reverse and printing the result. 2) Finding the second largest digit in a string of digits. 3) Counting the number of substrings containing only vowels in a given string. 4) Checking if two strings are anagrams by comparing their characters. 5) Returning the lexicographically maximum word in a given sentence.

Uploaded by

Swapnil singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

Strings 2 Assignment.

The document provides instructions for string manipulation problems in C++. It includes: 1) Concatenating a string with its reverse and printing the result. 2) Finding the second largest digit in a string of digits. 3) Counting the number of substrings containing only vowels in a given string. 4) Checking if two strings are anagrams by comparing their characters. 5) Returning the lexicographically maximum word in a given sentence.

Uploaded by

Swapnil singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C++ Assignments | Strings - 2 | Week 7

Input a string and concatenate with its reverse string and print it.
Input : str = "PWSkills"
Output : "PWSkillssllikSWP"
Input : str = "pw"
Output : "pwwp"

Find the second largest digit in the string consisting of digits from ‘0’ to ‘9’.
Input : str = "2947578"
Output : 8
Input : str = "1241"
Output : 2

Input a string and return the number of substrings that contain only vowels.
Input : str = "abjkoe"
Output : 4
Explanation : The possible substrings that only contain vowels are "a" , "o" , "e" , "oe"
Input : str = "hgdhpw"
Output : 0

Given an array of strings. Check whether they are anagram or not.


Input : s = "car" , t = "arc"
Output : True
Input : s = "book" , t = "hook"
Output : False

Given a sentence ‘str’, return the word that is lexicographically maximum.


Input : str = "proud to be pwians"
Output : pwians
Input : str = "decode dsa with pw"
Output : with
Note:- Please try to invest time doing the assignments which are necessary to build a strong
foundation. Do not directly Copy Paste using Google or ChatGPT. Please use your brain .

You might also like