Overview

LeetCode Weekly Contest 369

This article is a summary of the contest. I don’t plan to discuss each problem in detail, but will provide general ideas. The point of this article is self-reflection and improvement.

After reviewing the contest, it is not so difficult. Here is a brief description of my performance on each problem:

  • Problem 1: Simple simulation problem, an easy one.
  • Problem 2: Not difficult, but requires consideration of multiple cases. Unfortunately, I didn’t think thoroughly, resulting in 3 WA 😒.
  • Problem 3: a Medium-level DP problem. Initially struggled to come up with a solution, wasted time on the unsolved problem 4, but eventually solved it quickly 😋.
  • Problem 4: Despite being a hard-level problem and not solved during the contest, the code only exceeded time limits. After the contest, I figured out an optimization method by myself. Note that the messy logic during coding led to 2 WA 😒.
Read more »

Introduction

Azure Pipelines is a component of Azure DevOps (a SaaS platform) and serves as an automated CI/CD pipeline. Similar technologies include GitHub Actions and Jenkins.

As users, we only need to define various tasks in YAML, trigger the pipeline, and Azure Pipelines automatically executes these tasks for us.

So, how are tasks executed? Is there a limit to parallel tasks? How can we design YAML more efficiently to make a pipeline run faster? This article will analyze the architecture of Azure Pipelines from the perspective of task scheduling, providing answers to these questions along the way.

Read more »

Problem

Problem Source: NowCoder Online Test

Given an array $nums$ indexing from $0$ and a non-negative integer $k$.

In one operation, you can perform the following:

  • Choose an index $i$ not chosen before, where $i$ is in the range $[0, nums.length - 1]$.
  • Replace $nums[i]$ with any integer in the range $[nums[i] - k, nums[i] + k]$ (inclusive).

After applying any times of operations, return the maximum possible score of the array $nums$.

The array’s score is defined as the “maximum number of repeated elements in the array”.

Note that you can only apply the operation once for each index.

Read more »
0%