当前位置:网站首页>Buddha's foot before examination: the third bullet of leetcode
Buddha's foot before examination: the third bullet of leetcode
2022-06-24 02:22:00 【403 Forbidden】
subject :
answer :
def isValid(s):
s = list(s)
sym_dict = {")": "(", "}": "{", "]":"["}
stack =[]
close = []
if len(s)%2 == 0:
for i in range(len(s)):
if s[i] in sym_dict.values():
stack.append(s[i])
if s[i] in sym_dict.keys() and stack != [] and stack[-1] == sym_dict[s[i]]:
close.append(stack.pop())
if stack == [] and len(close) == len(s)/2:
return True
return False 边栏推荐
- The new purchased machines with large customized images are slow to enter the system
- Analysis report on market development trends and innovation strategies of China's iron and steel industry 2022-2028
- What is raid? 2000 words can explain RAID 0, 1, 5 and 10 thoroughly, and collect!
- How about Tencent cloud game server? Can the cloud game server play games
- Introduction to development model + test model
- Centeros environment setup
- [security] Tencent cloud double 12 is not limited to new and old users! Safe sub venue - discount guide! Unlimited account types!
- A variety of fixed assets inventory methods to deal with the year-end large inventory of fixed assets
- Leetcode838: push domino (medium)
- What is the industrial Internet? What is the industrial Internet platform?
猜你喜欢
Cloudpods golang practice

Introduction to development model + test model

How to fill in and register e-mail, and open mass mailing software for free

layer 3 switch

Advanced BOM tool intelligent packaging function

Stm32g474 infrared receiving based on irtim peripherals

Leetcode969: pancake sorting (medium, dynamic programming)

Review of AI hotspots this week: the Gan compression method consumes less than 1/9 of the computing power, and the open source generator turns your photos into hand drawn photos

If there are enumerations in the entity object, the conversion of enumerations can be carried out with @jsonvalue and @enumvalue annotations

application. Yaml configuring multiple running environments
随机推荐
How to use the cloud game server is the cloud server stable
How to handle the abnormal state of easycvr national standard cascading superior display?
How to obtain the information of easydss single / multiple live streams through the API interface?
Evaluation index of machine learning model
The cloud University of "digital and real integration, CO building authentic Internet" is surging forward
Tencent peace of mind ecological alliance was officially established as a linkage partner. Open technology helps "digital agriculture"
How to solve the problem of uncaught (in promise) when easywasmlayer plays a video?
Are cloud game servers expensive to rent? Factors to consider in cloud game server leasing
How to build a cloud game server what needs to be considered to build a cloud game server
What if the cloud desktop fails to connect to the server? How to use cloud desktop?
Cloud rendering: cloud exhibition hall of Tencent digital ecology Conference - open roaming mode on cloud
Mainstay of network detection - nping User Guide
Mysql Find_ IN_ Set function
Gin framework: add API logging Middleware
My eight year relationship with the message queue
What is the industrial Internet? What is the industrial Internet platform?
What information should be provided for enterprise trademark registration? Is it difficult to register a trademark?
Global and Chinese gallium industry market panoramic survey and investment strategy proposal report 2022-2028
How about Tencent cloud game server? Can the cloud game server play games
Shopify has quietly taken the second place in e-commerce in North America. Is independent station the "magic weapon" to win?