I was given 2 question to solve in 1hr of time .
**1st que **: https://leetcode.com/problems/fraction-to-recurring-decimal/ (Completely solved by me with all test cases passed )
2nd ques : ( was not able to solve this question )
Question:
A popular online retailer allows vendors to specify different prices in advance
for the same item throughout the day. We now need to design an algorithm that
helps identify the lowest price for the item at any point of the day.
Assumptions:
For the algorithm, assume all vendors are selling the same product
and there is only one product being sold. Given a list that has
vendor information - ( startTime, endTime, price ) of the deal,
return a sorted list with different possible intervals and
the least price of the product during the interval.
The interval is inclusive of start and end time.
All the 3 values passed by the vendor are integers.
sampleInput = { new Interval( 1, 5, 20 ), new Interval( 3, 8, 15 ), new Interval( 7, 10, 8 ) };
expectedOutput = { new Interval( 1, 2, 20 ), new Interval( 3, 6, 15 ), new Interval( 7, 10, 8 ) };
Guys please help me with 2nd question, I couldnot find similar ques on leetcode.
I got rejected finally as i solved only 1 question .