Overview

LeetCode Weekly Contest 370

This article is a summary of the weekly contest. I do not plan to discuss each problem in detail; for some problems, I will only provide a rough outline. The point of this article is self-reflection and improvement.

Achieved AC in the first three problems within 23 minutes, resulting in a ranking around 300 - more like a typing contest emphasizing speed rather than a coding contest. Brief description of problem-solving:

  • Problem 1: Easy problem but got stuck for 5 minutes 😒;
  • Problem 2: Similar to the first one in terms of background, also easy problem, but solved faster 😋;
  • Problem 3: A real medium-level problem that required a bit more thought, solved in 15 minutes, not bad 😋;
  • Problem 4: Couldn’t solve. If the data range is small, it’s a simple DP problem, but couldn’t find an optimization 😒;
Read more »

Problem

Source: 2127. Maximum Employees to Be Invited to a Meeting (Daily Problem)

A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any number of employees.

The employees are numbered from 0 to n - 1. Each employee has a favorite person and they will attend the meeting only if they can sit next to their favorite person at the table. The favorite person of an employee is not themselves.

Given a 0-indexed integer array favorite, where favorite[i] denotes the favorite person of the ith employee, return the maximum number of employees that can be invited to the meeting.

Example 1

Input: favorite = [2,2,1,2] Output: 3

image-20231101114926490image-20231101125447756

Read more »

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 »
0%