0%

Q:

Given an integer array nums and an integer k, return the length of the shortest non-empty subarray of nums with a sum of at least k. If there is no such subarray, return -1.

A subarray is a contiguous part of an array.

Read more »

Q:

You are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order). Each people[i] = [hi, ki] represents the ith person of height hi with exactly ki other people in front who have a height greater than or equal to hi.

Reconstruct and return the queue that is represented by the input array people. The returned queue should be formatted as an array queue, where queue[j] = [hj, kj] is the attributes of the jth person in the queue (queue[0] is the person at the front of the queue).

Read more »

KMP:

​ The KMP (Knuth-Morris-Pratt) algorithm is an algorithm for string search that finds the occurrence of a word W within a text string S.

The basic idea is that when a substring does not match the target string, it is known enough information to be able to determine that the next search step will not result in a missed check of the target string. In this way, the algorithm does not perform an invalid check.

The following are the steps of the KMP algorithm:

  1. Construct a “partial match table” (also called a “failure function”). This is an array, and for a given lookup word, each element of the table contains the position where the lookup word should jump when the match fails.
  2. Use this table to perform string searches. When a match failure occurs in a text string, you can skip directly to the previous part that is known not to match.
Read more »

Target:

Since there are too many files in Confluence at work, which are also cluttered and difficult to read, I hope chatGPT-based can help me quickly get the knowledge I want from the files

Read more »

Q:

Given an integer n, return all the numbers in the range [1, n] sorted in lexicographical order.

You must write an algorithm that runs in O(n) time and uses O(1) extra space.

Read more »

LeetCode-934

Question:

You are given an n x n binary matrix grid where 1 represents land and 0 represents water.

An island is a 4-directionally connected group of 1‘s not connected to any other 1‘s. There are exactly two islands in grid.

You may change 0‘s to 1‘s to connect the two islands to form one island.

Return the smallest number of 0‘s you must flip to connect the two islands.

Read more »

springboot+cucumber实践

why BDD

  • Achieve business objectives.”
  • Focus on user needs”
  • Good readability

Actually, there are other reasons for me as well:

  1. Due to objective reasons, sometimes I only receive the PRD (Product Requirements Document) after the project development is completed. Therefore, in the early stages of development, it is easier to identify issues by establishing clear business processes through certain means rather than diving directly into development. Compared to traditional documentation (DD documents), BDD (Behavior-Driven Development) features may be easier for non-developers to understand.
  2. Documentation tends to lag behind, but it helps me or other colleagues who take over the project in the future to quickly review or understand the requirements of a particular business.
Read more »

​ I had an idea of building a personal blog a long time ago, but I never put it into practice due to my studies and work. After I joined the new company, I decided to build a simple personal blog because I had time and some personal reasons, and the blog will record my technical problems and attempts, as well as record my learning and growth process.