logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

LeetCode //C - 1095. Find in Mountain Array

Approach Find the Peak: The mountain array first increases to a peak and then decreases. We use binary search to locate the peak element by comparing middle elements with their neighbors to determine

文章图片
#leetcode#c语言#算法
LeetCode //C - 1090. Largest Values From Labels

Approach Sort Items by Value: First, we create a list of items where each item consists of a value and its corresponding label. We then sort these items in descending order based on their values. This

文章图片
#leetcode#c语言#算法
LeetCode //C - 1081. Smallest Subsequence of Distinct Characters

This problem requires finding the lexicographically smallest subsequence of a string that contains all distinct characters exactly once. The solution involves using a stack to build the result while e

文章图片
#leetcode#c语言#算法
LeetCode //C - 1049. Last Stone Weight II

Approach The problem requires us to find the smallest possible weight of the last remaining stone after repeatedly smashing pairs of stones until at most one stone is left. The key observation here is

文章图片
#leetcode#c语言#算法
LeetCode //C - 1048. Longest String Chain

Approach The problem requires finding the longest possible word chain where each subsequent word is a predecessor of the next. A predecessor is defined as a word that can be transformed into another w

文章图片
#leetcode#c语言#算法
LeetCode //C - 1046. Last Stone Weight

This problem simulates smashing the two heaviest stones together repeatedly until at most one stone remains. The solution involves iteratively finding the two largest stones in the array, smashing the

文章图片
#leetcode#c语言#算法
LeetCode //C - 1045. Customers Who Bought All Products

Problem: Find customers who purchased all available products. Approach: Group customers by their ID and count the distinct products each bought. Compare this count with the total number of products in

文章图片
#leetcode#c语言#算法
LeetCode //C - 1030. Matrix Cells in Distance Order

Abstract The problem requires sorting all cells of a given matrix in ascending order of their Manhattan distances to the center point (rCenter, cCenter). The solution is to iterate through all cells,

文章图片
#leetcode#c语言#算法
LeetCode //C - 1018. Binary Prefix Divisible By 5

Abstract: This problem requires determining whether each prefix of a binary array is divisible by 5. By progressively calculating the remainder modulo 5 of each prefix, the problem of excessively larg

文章图片
#c语言#leetcode#算法
LeetCode //C - 1015. Smallest Integer Divisible by K

This problem requires finding the smallest number composed only of digit '1' that is divisible by a given integer k. The solution leverages modular arithmetic to efficiently compute remainders without

文章图片
#leetcode#c语言#算法
    共 77 条
  • 1
  • 2
  • 3
  • 8
  • 请选择