Re: [闲聊] 每日LeetCode

楼主: JerryChungYC (JerryChung)   2024-01-13 01:48:22
https://leetcode.com/problems/determine-if-string-halves-are-alike
1704. Determine if String Halves Are Alike
给一个偶数长度的字串s,把它分成两半。如果两半的元音数量相同则为Alike,传回True
Example 1:
Input: s = "book"
Output: true
Explanation: a = "bo" and b = "ok". a has 1 vowel and b has 1 vowel.
Therefore, they are alike.
Python Code:
楼主: JerryChungYC (JerryChung)   2024-01-13 01:58:00
作者: Rushia (みけねこ的鼻屎)   2024-01-13 02:43:00
n很小用set反而会拖效能吧

Links booklink

Contact Us: admin [ a t ] ucptt.com