In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article "determine whether the string is valid in java" is not quite understood by most people except programmers. Today, in order to make you understand "judging whether the string is valid in java", Xiaobian summed up the following content, which has a certain reference value. The detailed steps are clear and the details are handled properly. I hope you can get something through this article. Next let's take a look at the specific content.
Given a string that includes only'(',')','{','}','[',']', determine whether the string is valid.
A valid string must satisfy:
The left parenthesis must be closed with the same type of closing parenthesis.
The left parenthesis must be closed in the correct order.
Note that an empty string can be considered a valid string.
Example 1:
Enter: "()"
Output: true
Example 2:
Enter: "() [] {}"
Output: true
Example 3:
Enter: "(]"
Output: false
Example 4:
Enter: "([)]"
Output: false
Example 5:
Enter: "{[]}"
Output: true
Parsing:
Here, let front take n steps, then front and back go at the same time until front.next is empty, find the last but one node, and then delete it.
What are the basic data types of java? the basic data types of Java can be divided into: 1. Integer types, which are used to represent the data types of integers. 2. Floating point type, which is used to represent the data type of decimals. 3. Character type. The keyword of character type is "char". 4. Boolean type, which is the basic data type that represents logical values.
Thank you for your reading. I hope you have a certain understanding of the key issue of "judging whether the string is valid in java". The specific usage still needs to be understood by yourself. Try it quickly. If you want to read more articles about relevant knowledge points, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.