help me with the placing of the lamps. I have thought about an approach but it has O(n2) time complexity, one for loop to iterate 1-k and the other one for placing the lamps int their correct position, so that the whole street is lighted. But the process is a bit messy.
Please tell me how to solve the problem.
Asked by: Samrat_De on April 7, 2019, 6:34 p.m. Last updated on April 7, 2019, 6:34 p.m.