Can you anyone provide me with the test case I got wrong.Link to my submission is https://www.codechef.com/viewsolution/19321965
Logic: i used two index i and j denoting starting and ending of the consecutive of cities jitendra can visit and see if cost is less than k then if number of cities greater than previous then make new max and new rem amount.
Your logic is perfect. But, I don’t know why, you must spend the maximum possible money, if you can visit the same number of places for two different amounts, ie, the remaining money should be minimum.