We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I am surprised that I was able to get away with using a simple list structure (vector in C++). I started off with a simple, slow solution using std::sort, and then when that didn't pass, I made sure to insert each incoming int in the correct location. That was it. Not hard.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Running Median
You are viewing a single comment's thread. Return to all comments →
I am surprised that I was able to get away with using a simple list structure (
vector
in C++). I started off with a simple, slow solution usingstd::sort
, and then when that didn't pass, I made sure to insert each incomingint
in the correct location. That was it. Not hard.