Why lo>hi is required?

Isnt lo==hi sufficient??

@bhavik911
Isnt lo==hi sufficient??
Not sufficient
May be gives Run error

I mean lo ==hi while always arrive why would we need to tackle lo>hi conditon?

@bhavik911
5
3 6 4 1 2
try for this input

Okay.
How do i think of these types of corner cases while writing the code, i mean if I would have written it I would have just done lo ==hi,
How do i get to these type of corner cases?

Debug your code every time and do more number questions practice do more number questions practise

1 Like