Pergunta de entrevista da empresa Flipkart

1st Interview 2 questions , one was based on binary search and other was a simple greedy problem. The binary search question was not so easy to think, took some time 2nd interview 1st question was based on BFS , i was to find the no. of days for whole grid to be infected if there where some infected initially I did a whole lot of complex implementation , was not able to make the interviewer understand 2nd question : It was a simple one , to find the next greater number for a given number using the same digits