time complexity of this algorithm is O(n**2)??
Time complexity of this algorithm?
@Vipin_coder
the question u have tagged can be solved with different algorithms. Iām not sure which algorithm you are referring to
here is o(n) solution if u want to know
and nlogn" :
can you share java code please?
Sure
this is nlogn approach
Thank you so much, sort by value of HashMap in java is hard as compared to cpp 
no problem
just try to understand it once by dry running the code and it ll get easier .
If this resolves your doubt please mark it resolved