Sort in linear time

dono mein se kaun sa approach mein time complexity kam lagega?

@tusharjha9835 Both are done in O(n) bu the above method has a much cleaner code and is easier to understand.