leetcode brush Title records day024:20 and 118

20. Easy to use: 45% pass rate Method 1: Origin: Failed Violence: For my own future review, there are all kinds of situations that I did not think of at first but follow up and corresponding responses Principle: Normally judge if the current item and the next item are a bunch of parentheses, and add the response of the left parentheses group ...

Posted on Tue, 12 Oct 2021 15:49:40 -0400 by vronsky

leetcode brush record day021:326 and 204

326. Simple difficulty: Requirement: do not use loops or recursion to complete the problem Note: 0 times of 3 = 1, which also needs to be taken into account. Method 1: Trial Division: time complexity: O(log n) space complexity: O(1) We keep dividing n by 3 until n=1. If n cannot be divided by 3 in this process, it means that n is not a power ...

Posted on Sat, 09 Oct 2021 03:28:21 -0400 by rubbertoad

LeetCode 326.Power of Three is simple

This article belongs to "Conquer LeetCode"One of the series, which began officially in 2021/08/12. Because some of the titles on LeetCode are locked, this series will last at least until the day all the unlocked titles are brushed off. Because LeetCode is still creating new titles, the end date of this series may be forever. In this s ...

Posted on Tue, 28 Sep 2021 12:13:16 -0400 by shakuni