Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Area of Square

Given an MxN matrix filled with


X's and O's, find the largest square containing only X's and return its area. If there are no Xs in the entire matrix print 0.Input

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.


Output

The output should be a single line containing the area of the maximum square.


Explanation

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 O X X

X O O X O


The matrix from indices (1, 3) to (2, 4) has the maximum square with

X. So the output should be the area of the maximum rectangle with X, which is 4.

Sample Input 1

4 5

X O X O O

X O X X X

X X O X X

X O O X O

Sample Output 1

4

Sample Input 2

3 3

O X X

O X X

O O O

Sample Output 2

4



a = [int(i) for i in input("Enter list of numbers: ").split()]

please explain this line in detail


Write this assignment using data classes 

1 Create a class Person a. Initialize a class Person with FirstName, LastName, Age, Address, and Contact Number.


2. Create a class Employee 

a. Employee is a Person so Employee is a child class of Person class. Employee class constructor/__init__ method will contain all the attributes of Person class and Employee class own attributes which are EmployeeID, OrganizationName and Position.


3. Create a class CommissionEmployee

a. CommissionEmployee is a child class of Employee class. It should inherit all the attributes of

Employee class and its own attribute which is commissionRate

b. Create a method called calculateCommission, which should take input of gross sale from the

user and based on the commission rate calculate the totalEarning.

c. Create a method called displayData which should display the FirstName, LastName, Age,

Address, ContactNumber, EmployeeID, OrganizationName, Position, commissionRate and

totalEarning. 



Write a program that use dictionaries to build tables. Complete a method that

receives 2 parameters. The first parameter states how many entries are in the dictionary and the second

number represents the multiplier for each entry.


Ex:

Input: 10, 5


Output: {1: 5, 2: 10, 3: 15, 4: 20, 5: 25, 6: 30, 7: 35, 8: 40, 9: 45}



printing sentence in decreasing order based on number

example

input= It took 13days 14nights to reach delhi by walk

output=It took 14days 13nights to reach delhi by walk (as decreasing order is 14,13 just numbers got replaced not word)


Given a list of different right and left foot shoes, write a python code to return the exact number of shoe pairs which can be formed from the given list. Also, return how many number of shoes of which foot are required to form pairs with the unpaired shoes.



Input Format



Input_list = ['R','L','L','R','R',R','R,'L']



Constraints



.



Output Format



Paired: 3



Unpaired: 2



Required left Shoes



Sample Input 0



8


L R L L R L R L


Sample Output 0



Paired: 3


Unpaired: 2


Required right shoes


Sample Input 1



9


R L R L R R L R R


Sample Output 1



Paired: 3


Unpaired: 3


Required left shoes


Sample Input 2



6


R R R R R R


Sample Output 2



Paired: 0


Unpaired: 6


Required left shoes


Sample Input 3



8


L L R L R R L R


Sample Output 3



Paired: 4


Unpaired: 0

Given the following student data:



image



Write a Python code to print('Welcome student name') if both username and password entered by user match for that student. Note: Check first username and then password



Input Format



Username: 122



Password: Ghi122



Constraints



i) If entered username is not present in the list of usernames, then print Enter a valid username



ii) If entered password is not present in the list of passwords, then print Password Incorrect



iii) If both username and password belong to the same student, then print Welcome student_name



iv) If username and password do not belong to the same student, then print Username and password do not match



Output Format



Output: Welcome Ghi

Q1) Write a Python program to find the list of reverse of the elements in the given list would be prime number.



Input Format



[ 74, 5, 33, 79, 12, 56]



Constraints



1.If there is no prime number in the given list then print**('No prime number')**



Output Format



List of prime numbers: [74, 5, 79]



(or)



No prime number

Write a function which prints the fine for breaking traffic rules. The function should take two parameters: Speed and Helmet.



Input Format



helmet = 0 (worn)



helmet = 1 (not worn)



speed = 60 km/hr



Constraints



Speed limit = 60 km/hr



Rules:



1. If speed > speed limit and helmet is worn, then fine = Rs 1000;



2. If speed <= speed limit and helmet is not worn, then fine = Rs 2000;



3. If speed > speed limit and helmet is not worn, then fine = Rs 5000;



4. If speed <= speed limit and helmet is worn, then print 'No Fine'



Output Format



Fine: Rs 1000



(or)



No Fine

An e-commerce company plans to give their customers a special discount for the Christmas They are planning to offer a flat discount. The discount value is calculated as the sum of all the prime digits in the total bill amount.






Write an algorithm to find the discount value for the given total bill amount.

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS