Area of Largest Rectangle in Histogram
Given an list of integer
The input will be a single line containing space-separated integers, denoting the heights of the bars.
The output should be a single line containing the area of the largest rectangle in the rectangle.
For example, if the given list of numbers are
2 1 5 6 2 3 , when they are drawn adjacent to each other according to their heights, the histogram will be like The largest rectangle can be found in between 5 and 6, which is 10.
Sample Input 1
2 1 5 6 2 3
Sample Output 1
10
Sample Input 2
65 87 96 31 32 86 57 69 20 42
Sample Output 2
248
In 4 moves, reposition the circles from position 1 to position 2. One move means sliding a circle clockwise, Counter Clockwise, left or right at least touching the nearest 2 circles. Otherwise invalid move.
Link photo
https://www.chegg.com/homework-help/questions-and-answers/coin-please-need-code-algorithm-python-need-working-code-thankyou-screenshot-main-program--q77289194
Palindrome Pairs
Given a list of unique words, write a program to print all the pairs of the distinct indices (i, j) in the given list, so that the concatenation of two words at indices i and j is a palindrome.
The input will be a single line containing a sentence.
The output should be printing each distinct pair of indices (i, j) each in a line in ascending order.
If there are no distinct pairs found, print "-1"
Note: Consider (i, j) and (j, i) as two different pairs.
For example, if the given sentence is
was it a car or a cat I saw
The words that can be concatenated to make a palindrome are
WordsIndices(was, saw)(0, 8)(a, a)(2, 5)(a, a)(5, 2)(saw, was)(8, 0)
Sample Input 1
was it a car or a cat I saw
Sample Output 1
0 8
2 5
5 2
8 0
Concatenate Word Pairs
Given a sentence and an integer L, write a program to concatenate word pairs so that the concatenated word has the length L.
The first line of input will be a sentence.
The second line of input will be an integer L.
The output should be containing the unique concatenated word pairs each in a line in the lexicographical order.
For example, if the given sentence and L are
Welcome to your exam
6
The words which can be paired so that they make concatenated word with length 6 are
Word1Word2toyourtoexamexamtoyourto
So the output should be printing each concatenated word in a line in the lexicographical order
examto
toexam
toyour
yourto
Sample Input 1
Welcome to your exam
6
Sample Output 1
examto
toexam
toyour
yourto
Sample Input 2
My parents and I went to a movie
9
Sample Output 2
Myparents
moviewent
parentsMy
parentsto
toparents
wentmovie
Area of Rectangle
Given an MxN matrix filled with
The first line of input will be containing two space-separated integers, denoting M and N.
The next M lines will contain N space-separated integers, denoting the elements of the matrix.
The output should be a single line containing the area of the maximum rectangle.
For example, if the given M, N and elements of matrix are as the following
4 5
X O X O O
X O X X X
X X X X X
X O O X O
The matrix from indices (1, 2) to (2, 4) has the maximum rectangle with
X. So the output should be the area of the maximum rectangle with X, which is 6.
Sample Input 1
4 5
X O X O O
X O X X X
X X X X X
X O O X O
Sample Output 1
6
Sample Input 2
3 3
O X X
O X X
O O O
Sample Output 2
4
Number to English Words
Write a program to convert a non-negative integer
The input will be a single line containing an integer
The output should be a single line containing the representation of the English words of number
For example, if the given number is 123, your code should print the English words representation, which is
One Hundred Twenty Three
Sample Input 1
123
Sample Output 1
One Hundred Twenty Three
Sample Input 2
10005
Sample Output 2
Ten Thousand Five
Sample Input 3
1234567891
Sample Output 3
One Billion Two Hundred Thirty Four Million Five Hundred Sixty Seven Thousand Eight Hundred Ninety One
Write a software (bot) that gives 80% to 90% ROI, and the software will be able to win 10 to 20 or more trades in a row every day.
Number to English Words
Write a program to convert a non-negative integer
The input will be a single line containing an integer
The output should be a single line containing the representation of the English words of number
For example, if the given number is 123, your code should print the English words representation, which is
One Hundred Twenty Three
Sample Input 1
123
Sample Output 1
One Hundred Twenty Three
Sample Input 2
10005
Sample Output 2
Ten Thousand Five
Area of Rectangle
Given an MxN matrix filled with
The first line of input will be containing two space-separated integers, denoting M and N.
The next M lines will contain N space-separated integers, denoting the elements of the matrix.
The output should be a single line containing the area of the maximum rectangle.
For example, if the given M, N and elements of matrix are as the following
4 5
X O X O O
X O X X X
X X X X X
X O O X O
The matrix from indices (1, 2) to (2, 4) has the maximum rectangle with
X. So the output should be the area of the maximum rectangle with X, which is 6.
Sample Input 1
4 5
X O X O O
X O X X X
X X X X X
X O O X O
Sample Output 1
Guess my ID game: Use python while loops to make your friends guess your ID.
Store your ID in a variable called myID.
After students run your code, they will guess what your ID. Is.
Those who don't guess the number will be stuck in an endless loop!
Those who guess the number will end the loop and get a congratulations message!
Start your code with the following message:
Hi, my name is your name. Welcome to my game.
Guess my number
If the number chosen by the user is different than your ID, the user should see the message “You're stuck in my loop!" and be prompted to enter a number again.
If the number entered by the user matches your ID, the number should be printed to the screen, and you should say the following words: "Well done! You are free now."