message: Update maximum-of-minimum-values-in-all-subarrays.cpp
diff: class Solution {
  public:
  vector<int> findMaximums(vector<int>& nums) {
  - const auto& left = find_bound(nums, 0, size(nums), -1);
  - const auto& right = find_bound(nums, size(nums) - 1, -1, size(nums));
  + const auto& left = find_bound(nums, 1);
  + const auto& right = find_bound(nums, -1);
  vector<int> result(size(nums), -1);
  for (int i = 0; i < size(nums); ++i) {
  result[((right[i] - 1) - left[i]) - 1] = max(result[((right[i] - 1) - left[i]) - 1], nums[i]);
  @@ -17,12 +17,14 @@ public:
  }
  private:
  - vector<int> find_bound(const vector<int>& nums, int begin, int end, int init) {
  - vector<int> result(abs(end - begin), init);
  + vector<int> find_bound(const vector<int>& nums, int d) {
  + const int init = d > 0 ? -1 : size(nums);
  + const int begin = d > 0 ? 0 : size(nums) - 1;
  + const int end = d > 0 ? size(nums) : -1;
  + vector<int> result(size(nums), init);
  vector<int> stk = {init};
  - const int d = (end - begin) > 0 ? 1 : -1;
  for (int i = begin; i != end; i += d) {
  - while (stk.back() != -1 && stk.back() != size(nums) && nums[stk.back()] >= nums[i]) {
  + while (stk.back() != init && nums[stk.back()] >= nums[i]) {
  stk.pop_back();
  }
  result[i] = stk.back();
  