day3
day3
day3
Description:
You are two positive integers upper and lower. Fins the sum of all the numbers that
are even-valued in the given range of upper and lower where both are inclusive.
Print -1 if upper and lower are less than zero.
Constraints:
upper, lower >= 0
Example:
Input:
10
20
Output:
90
Explanation:
Sum of even-valued elements between 10 and 20 is 10+12+14+16+18+20 = 90
-----------------------------------------------
2.Description:
Write a program to take input as a string from user and Task is to eliminate the
given two letters from the given words or sentences and display the resultant
words.
Constraints:
The input string may contain alphabetic characters (both uppercase and lowercase),
numbers, symbols, or spaces.
The input string length can range from 1 to 10^5 characters.
The letters to eliminate can be any alphabetic characters (both uppercase and
lowercase).
Example:
I/p:
Instacks
O/p:
Inack
Explanation:
In the given example 's' and 't' are removed from the given string
-----------------------------------------------------
3.Description:
Find if a number is a palindrome or not by following the below steps:
Output:
4884
Explanation:
Sum of 87 and its reverse (78) is 87 + 78 = 165.
The reverse of 165 is 561.
The sum 561 is not a palindrome.
Repeat the steps: 561 + 165 = 726. The reverse of 726 is 627.
The sum 627 is not a palindrome.
Repeat the steps: 627 + 726 = 1353. The reverse of 1353 is 3531.
The sum 3531 is not a palindrome.
Repeat the steps: 3531 + 1353 = 4884. The reverse of 4884 is 4884.
The sum 4884 is a palindrome, so print 4884
---------------------------------------------