2024年11月

Combination Sum

[LeetCode] 0039. Combination Sum

Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.

The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different.

The test cases are generated such that the number of unique combinations that sum up to target is less than 150 combinations for the given input.

[LeetCode] 0039. Combination Sum 阅读更多 ”

Leetcode, 技术文章
Longest Common Subsequence

[LeetCode] 1143. Longest Common Subsequence

Given two strings text1 and text2, return the length of their longest common subsequence. If there is no common subsequence, return 0.

A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

For example, “ace” is a subsequence of “abcde”.
A common subsequence of two strings is a subsequence that is common to both strings.

[LeetCode] 1143. Longest Common Subsequence 阅读更多 ”

Leetcode, 技术文章
初步认识资料结构:程式新手应该知道什么?三大学习技巧一次看!

初步认识资料结构:程式新手应该知道什么?三大学习技巧一次看!

学习程式设计时,常常听到「资料结构」这个词。它到底是什么?为什么要学?又该如何开始?这篇文章将用简单的比喻和实用的例子,帮助你快速了解资料结构的基础概念,让你能轻松入门! 😊

初步认识资料结构:程式新手应该知道什么?三大学习技巧一次看! 阅读更多 ”

软体工程师,
Number of 1 Bits

[LeetCode] 0191. Number of 1 Bits

Write a function that takes the binary representation of an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight).

Note:

Note that in some languages, such as Java, there is no unsigned integer type. In this case, the input will be given as a signed integer type. It should not affect your implementation, as the integer's internal binary representation is the same, whether it is signed or unsigned.
In Java, the compiler represents the signed integers using 2's complement notation. Therefore, in Example 3, the input represents the signed integer. -3.

[LeetCode] 0191. Number of 1 Bits 阅读更多 ”

技术文章
zh_CN简体中文