Max Profit
You given a list of prices where prices[i] is the price of a given stock o the i th day write a program to print the maximum profit by choosing a single day to buy a stock and choosing a different day in the future to sell that stock if these is no profit that can be achieved return 0.
Input
The input is a single line containing space seperated integers.
Output
The output should be a single line integer.
Explanation
In the example the given prices are 7 1 5 3 6 4.
buying stocks on day two having price 1 and selling them on the fifth day having price 6 would give the maximum profit which is 6 - 1
so the output should be 5.
Sample Input1
1 2 1 3 6 7 4
Sample Output1
6
You are given an m*n matrix.write a program to compute the perimeter of the matrix and print the result.Perimeter of a matrix is defined as the sum of all elements of the four edges of the matrix.
Input
The first line of input containing the positive integer.
The second line of input containing the positive integer.
The next N lines of input space-separated integers.
Explanation
The input should be
3
4
1 2 3 4
5 6 7 8
9 10 11 12
The output should be 1+2+3+4+8+12+11+10+9+5 = 65
Sample Input1
3
4
1 2 3 4
5 6 7 8
9 10 11 12
Sample Output1
65
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 T represents the number of extra spaces a line should have in the beginning compared to its next line. The last line of the pattern does not have any spaces in the beginning.
Explanation:
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 spaces characters when compared to its next line.
Sample Input1
2
2
Sample Output1
**
**
Sample Input2
3
2
Sample Output2
***
***
***
In a university, there is a certain system of credits. Each of student is given a ‘credit limit’ which specifies the maximum credits of a subject they can take. A student can take any number of subjects which are under his/her credit limit.
There are N students and K subjects.Each subject has a specified number of credits .when student choose a subject ,it becomes a (student,subject)pair.
Find the maximum number of possible(subject,student)pairs for the given credit limits and subject credit requirements.
Input1:K denoting the number of subjects
Input2:An array of K elements each denoting the credits to take a subject
Input3:N denoting the number of students
Input4:An array of N elements each denoting the credit limit of a student.
Output:Your should return the maximumnumber of possible required pairs.
Example1:
Inpput1:3
Input2:{44,45,56,39,2,6,17,75}
Input3:1
Input4:{54}
Output:6
: Default constructor with default parameters for hours, minutes, and seconds, all set to zero. Overloaded extraction operator that prompts a user to enter the values for hours, minutes, and seconds for the Time. Continuously prompt the user if the entered value is not valid for a 24-hour clock. Overloaded insertion operator to display the Time in the form hr:min: sec. If hours, minutes, and/or seconds is a single digit, the time should be shown as 0x: where x is hours, minutes, or seconds. Example: 02:33:45, 13:05:66, 23:17:09 Overloaded prefix increment and postfix increment operators to increment the Time by one second. Overloaded subtraction operator that returns a Time object that indicates the difference between two Times. Overloaded == operator that returns true or false indicating that two Times are the same or not, respectively. Two Times are the same if they have equal values for hours, minutes, and seconds.
Akshya is given a list of N integers. Each number in the list appears exactly for one number. help akshya by identifying the numbers which appeared exactly once in the list.
Input
The input contains a single-line comma-separated integers.
Output
The output contains a single-line comma-separated integers.
Sample Input1
8,9,5,8,5,6
Sample Output1
9,6
Sample Input2
1,2,3,4,5,1,2,3,4
Sample Output2
5
The principal of a school wants to speak with some of the students to assess their over all development including studies,most of the teachers were selecting the toppers of their classes but Mr,sam thought of an idea to select the bunch of students who did not have much difference in their marks so that he gains the reputation of a teacher who teaches well to the whole class and not just to a bunch of brilliant students.
Your are required to help mr,sam in selecting K students that can speak with principle from his class .you need to return an integer array representing the marks of the selected students sorted in ascending order.
Example1:
Input1:10
Innput2:{950,477,55,602,881,302,859,438,551,382}
Input3:1
Output:{950}
Andy has the word W and he wants to print the unique characters in the word in the order of their occurrence.write a program to help Andy print the unique characters as described above.
NOTE : consider lower and upper case letters as different
Input
The input is a single line containing the word W.
Output
The output should be a single line containing space separated characters.
Explanation
In the example, the word is MATHEMATICS
The unique characters in the given word are M, A, T, H, E, I, C, S, in the order of occurrence.so the output should be M A T H E I C S.
Sample Input1
MATHEMATICS
Sample Output1
M A T H E I C S
Sample Input2
banana
Sample Output2
b a n
NMIMS Global Access School for Continuing Education (NGA-SCE)
Course: IT Project Management
3. Describe following IT project risks.
a. Schedule and Budget risk (5 Marks)
b. Technical risk (5 Marks)
"I WANT FULL LONG ANSWER"
NMIMS Global Access
School for Continuing Education (NGA-SCE)
Course: IT Project Management
2. In a software development company, development team keeps getting change requests
from the client and other stakeholders. Company is planning to establish a change
management process. Describe the change management process. (10 Marks)
"I WANT FULL LONG ANSWER"