 Time:\max(O(m\log m), O(n\log n)), where m = \texttt{houses} and n = \texttt{heaters}
 Space:O(1)
C++ 


JAVA 


C++ 


JAVA 

