0% found this document useful (0 votes)
2 views6 pages

String Related Problems-2

The document outlines several programming problems involving string manipulation, including counting ASCII characters within a range, stripping characters from a string, rotating strings left or right, transforming strings by changing letter cases and moving special characters, and rotating based on the sum of squares of digits. Each problem specifies input formats, sample inputs, and expected outputs. The problems require basic string operations and understanding of ASCII values.

Uploaded by

Ashutosh Tiwari
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)
2 views6 pages

String Related Problems-2

The document outlines several programming problems involving string manipulation, including counting ASCII characters within a range, stripping characters from a string, rotating strings left or right, transforming strings by changing letter cases and moving special characters, and rotating based on the sum of squares of digits. Each problem specifies input formats, sample inputs, and expected outputs. The problems require basic string operations and understanding of ASCII values.

Uploaded by

Ashutosh Tiwari
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

28 ASCII Range Character Counter

Given a string (S) of length K, and two integers, N and M.


Problem
Count the number of characters, whose ASCII value is within
Statement
the range defined by N, M (both inclusive). Given that N < M.
Input First line has 3 space separated integers K, N and M.
Format
Output A single input.
Format
Sample 15 67 75
Input AB*abXYDEF#@pqr
Sample 3
Output
29 Strip Characters
Given a string (S) of length N, and an integer (K). Print S, after
Problem
stripping the first K and the last K characters. You can
Statement
assume that 2K < N.
Input First line has two input numbers N and K. Second line has a
Format input string.
Output Single line string output.
Format
Sample 11 3
Input abcdefghikj
Sample defgh
Output
31 Rotate String - 1
Rotate the given string S of length N by K places towards left.
Problem
Given that K <= N.
Statement

Input First line has 2 space separated number N and K.


Format Second line has an input string.
Output A single line output string.
Format
Sample 13 3
Input quickfoxbrown
Sample ckfoxbrownqui
Output
32 Rotate String - 2
Rotate the given string S of length N by K places towards
Problem
right. Given that K <= N.
Statement

Input First line has 2 space separated number N and K.


Format Second line has an input string.
Output A single line output string.
Format
Sample 13 3
Input quickfoxbrown
Sample ownquickfoxbr
Output
35 Transform String
Given a string consisting of digits, alphabets and special
characters. Transform this string into another by converting
Problem
all alphabets into small case letters, leaving digits as it is and
Statement
moving the special characters at the end. Print the
transformed string.
Input First line has a single input number N. Second line has an
Format input string.
Output A single line output.
Format
Sample 15
Input abc12AD34@##123
Sample abc12ad34123@##
Output
36 K Rotate
Given an alphanumeric string, S. Let the sum of squares of
Problem digits in S be K. If K is even, rotate the alphabets of S
Statement rightwards by K positions, otherwise rotate it leftwards by K
positions. Print the rotated string.
Input First line has a single input number N. Second line has an
Format input string.
Output A single line output.
Format
Sample 9
Input 2ab3cd45e
Sample bcdea
Output

You might also like