Sorting Programs in C
1 / 6
Input : NA
Output : NA
Tags:No Tags on this question yet!
2 / 6
Input : NA
Output : NA
Tags:No Tags on this question yet!
3 / 6
Input : 1 0 1 1 0 1 0 1 0 0 0 1 0 1
Output :
4 / 6
Input : NA
Output : NA
Tags:Amazon
5 / 6
The function has the following parameters:
cars: integer array of length denoting the parking slots where cars are parked
k: integer denoting the number of cars that have to be covered by the roof
Example:
Input:
cars: [2, 10, 8, 17]
k: 3
output: 9
Explanation: you can build a roof of length 9 covering all parking slots from the 2nd one to the 10th one, so covering 3 cars at slots 2, 10, 8, there are no shorter roof that can cover 3 cars, so the answer is 9
Note:
1 <= n <= 10^5
1 <= k <= n
1 <= cars[i] <= 10^14
All slots token by cars are unique
Input : cars: [2, 10, 8, 17]
k: 3
Output :
Tags:Amazon
You can practice here all the basics and standard Sorting program asked at freshers or experienced level job interview. Practice our hand-picked Sorting coding interview questions asked in coding round of various it companies and exams. You can programed these given question in any language, you can post your answer and same time you can review other users answer. It is always recommanded to write your own Sorting coding questions answer first and then refer others answers. At this page we have covers all the Sorting coding questions in 2020 and previously asked in their Interview round or coding rounds.
Top Kudos Contributor
Trending Programming Qs.
- Write a program to print next to the last word of a sentence.
- Write a program to reverse the string?
- Write a program to reverse the string?
- Write fibonacci series program. INPUT: 10 term OUTPUT: 0 1 1 2 3 5...
- Given a string, say sentence=" this is crazy and fun" and a list, say ...
- Write a program to print the pyramid up to the passed integer value. ...
Last Month Contributor
- Write a program to count the no. of words in the given string?
- Write a program to print next to the last word of a sentence.
- Write a program to reverse the string?
- Write a program to convert uppercase to lower case and vice versa of a...
- Given a string, say sentence=" this is crazy and fun" and a list, say ...