message: Update number-of-visible-people-in-a-queue.cpp
diff: @@ -7,12 +7,15 @@ public:
  vector<int> result(size(heights));
  vector<int> stk;
  for (int i = 0; i < size(heights); ++i) {
  - while (!empty(stk) && heights[stk.back()] <= heights[i]) {
  + while (!empty(stk) && heights[stk.back()] < heights[i]) {
  ++result[stk.back()]; stk.pop_back();
  }
  if (!empty(stk)) {
  ++result[stk.back()];
  }
  + if (!empty(stk) && heights[stk.back()] == heights[i]) {
  + stk.pop_back();
  + }
  stk.emplace_back(i);
  }
  return result;
  @@ -32,6 +35,9 @@ public:
  stk.pop_back();
  }
  result[i] = !empty(stk) ? cnt + 1 : cnt;
  + if (!empty(stk) && heights[stk.back()] == heights[i]) {
  + stk.pop_back();
  + }
  stk.emplace_back(i);
  }
  return result;
  