Timetable Extractor using Python
1. Create a simple database and table structure (0NF) for timetable schedule in SQLite
2. Create a Python function (def) to:
a. read all timetables in Microsoft Excel format
b. extract the timetable contents
c. store the contents into the created table (in item #1)
3. Illustrate a flowchart for the overall task workflow
Chat started
1. Create a SQLite database for Places‐of‐Interests (POI) 2. Apply the CRUD concept using Python‘s function (def) 3. Test each of your CRUD functions with the following use case: a. Create the appropriate table with it‘s table structure, b. Populate 20 POIs into the table c. Get the latest row in the table d. Retrieve all POI data e. Update several POI data f. Delete two POI records g. Undo the deletion record proces
Max Contiguous Subarray input 2 -4 5 -1 2 -3
Parallelogram
Write a program to print a parallelogram pattern with
* characters. The size N represents the length (the number of * characters in each line) & breadth (the number of lines) of the parallelogram.The slope of the parallelogram
The input contains an integer
The output should have
Given
N = 3 and T = 2.Each line should have
3 star(*) characters. The last line should have 0 spaces at the beginning. Each line has 2 extra space characters when compared to its next line.
Sample Input 1
2 2
Sample Output 1
**
**
Sample Input 2
3 2
Sample Output 2
***
***
***
Leaders
You are given a list(
A) of integers. An element is a leader if it is greater than all the elements to its right side. And the rightmost element is always a leader.Write a program to print all the leaders in the list by maintaining their relative order.
The input contains space-separated integers denoting the elements of the list
The output should have the numbers in
Given
A = [4, 5, 1, 3, 2].The number
5 has no numbers that are greater than itself to its right side. The number 3 has no numbers that are greater than itself to its right side. The last number 2 is always a leader.So the leaders are
5 3 2.
Sample Input 1
4 5 1 3 2
Sample Output 1
5 3 2
Sample Input 2
9 8 10 12
Sample Output 2
12
Minimum Platforms
You are given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept wait
The first line contains space-separated integers that represent the arrival time of the trains.
The second line contains space-separated integers represent the corresponding end time of the trains.
The output should have an integer that represents the number of platforms needed to arrange the commute of all the trains.
Explanation: The arrival times of 5 trains are
0900 0940 0950 1100 1500. The departure times of 5 trains are 0910 1200 1120 1130 1900.The first platform will be used to run the trains that arrive at
0900 0940 1500. The second platform will be used to run the trains that arrive at 0950.
Sample Input 1
0900 1100 1235
1000 1200 1240
Sample Output 1
1
Sample Input 2
0900 0940 0950 1100 1500
0910 1200 1120 1130 1900
Sample Output 2
3
Check Anagrams
For a given pair of words check if they are anagrams. Print
YES if they are anagrams, or else print NO.Two words are anagrams if one word can be obtained by the rearrangement of the characters in another word.
INPUT: The first line of the input contains an integer
OUTPUT: The output should have the status of each of the
N pairs that are given in the input.All the statuses are separated by space.
Given pairs
dew wed
race care
In the word
dew, characters can be rearranged in the reverse order to get the word wed.So both the words are anagrams. The status of this pair is YES.
From the word race, when the characters r and c are swapped we will get the word care. So both the words are anagrams. The status of this pair is
YES.
Sample Input 1
2
dew wed
race care
Sample Output 1
YES YES
Sample Input 2
3
part trap
car air
some sum
Sample Output 2
YES NO NO
Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.
where Pi's are powers in decreasing order, Ci is coefficient, and C0 is constant. There will be space before and after the plus or minus sign.If the coefficient is zero, then don't print the term.
If the term with the highest degree is negative, the term should represent -Cix^Pi.
For the term where power is 1, represent it as C1x instead of C1x^1.
For term Cix^Pi, if the coefficient of the term Ci is 1, print x^Pi instead of 1x^Pi.
Explanation
If N = 4 If N = 5
If N=4
polynomial represents "6x^3+10x^2+5"
If N=5
polynomial represents "7x^4+6x^3+x^2+3x+2"Given polynomial,write a program that prints polynomial in Cix^Pi+Ci-1x^Pi-1+ ..+C1x+ C0 format. Input:The first line contains a single integer N. Next N lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes coefficient of Pi.Output Print the polynomial in the format Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0, where Pi's are powers in decreasing order, Ci is coefficient, and C0 is constant. There will be space before and after the plus or minus sign. If the coefficient is zero, then don't print the term.If the term with the highest degree is negative, the term should represent -Cix^Pi. For the term where power is 1, represent it as C1x instead of C1x^1. If the polynomial degree is zero and the constant term is also zero, then print 0 to represent the polynomial.For term Cix^Pi, if the coefficient of the term Ci is 1, print x^Pi instead of 1x^Pi.Explanation
Input
4
0 5
1 0
2 10
3 6
Output
6x^3 + 10x^2 + 5
Input
5
0 2
1 3
2 1
4 7
3 6
Output
7x^4 + 6x^3 + x^2 + 3x +5
Two polynomials A and B are given, add two polynomials A and B