LeetCode20

学习路线:

这个方向初期比较容易入门一些,掌握一些基本技术,拿起各种现成的工具就可以开黑了。不过,要想从脚本小子变成黑客大神,这个方向越往后,需要学习和掌握的东西就会越来越多以下是网络渗透需要学习的内容:
在这里插入图片描述

需要体系化学习资料的朋友,可以加我V获取:vip204888 (备注网络安全)

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化资料的朋友,可以点击这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

示例2:

输入:s = "()[]{}"
输出:true


示例3:

输入:s = "(]"
输出:false


示例4:

输入:s = "([)]"
输出:false

解题思路

题目的意思我给大家翻译翻译:
把括号之间的匹配想象成找对象,左括号(不管它是大括号还是小括号)看成是女生,右括号看成是男生,因为男生需要主动去匹配左括号。而找对象还要讲究看对眼、有感觉。还要找离自己最近的,没有对象的女生(未匹配的左括号)。如果恰好右括号匹配了一个左括号,那么他们就算是成了,轮到下一个男生。直到所有男生都找完了。这时候如果还有剩下的人,不管是男是女。都是剩下了,就不够皆大欢喜。需要返回false。如果没有剩下的,每个人都找到自己的心上人了,那就返回true。

还有一种情况,就是上面的示例4,')'离得最近的左括号是'['。
这个男生喜欢的是黑长直,但是他最近的女生是短发。
这哥们心态炸了,不谈了,心一横,
那就都别谈了。就要返回false了。

我们来看看ASCII码对照表,发现括号的ASCII值要么是相差1,要么是相差2.这个信息后面会用到。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

具体到代码上,可以用栈来解决。遍历题目给的字符串,如果是左括号(女生)那就放到栈里,如果是右括号,那就是男生了。看看和栈顶的括号匹配不,如果匹配了那就弹出出栈当前栈顶的元素,如果不匹配就返回false。到最后查看栈是不是空的,如果是空的就皆大欢喜,返回true,不为空的话就返回false。回到上面ASCII表中,如果两个括号能匹配,那么他们的ASCII相差一定不大于2。知道这些就可以写代码了。


实现代码:

class Solution {
    public boolean isValid(String s) {
    Stack<Character> stack=new Stack<> ();
        for(int i=0;i<s.length ();i++){
            char ch=s.charAt (i);
            if(ch=='(' || ch=='{' || ch=='['){
                stack.add (ch);
            }else {
                if(!stack.empty () && Math.abs (stack.peek ()-ch)<=2){
                    stack.pop ();
                }else {
                    return  false;
                }
            }
        }
        return  stack.isEmpty ();
}


### 给大家的福利


**零基础入门**


对于从来没有接触过网络安全的同学,我们帮你准备了详细的学习成长路线图。可以说是最科学最系统的学习路线,大家跟着这个大的方向学习准没问题。


![](https://img-blog.csdnimg.cn/img_convert/95608e9062782d28f4f04f821405d99a.png)


同时每个成长路线对应的板块都有配套的视频提供:


![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/a91b9e8100834e9291cfcf1695d8cd42.png#pic_center)

因篇幅有限,仅展示部分资料

**需要体系化学习资料的朋友,可以加我V获取:vip204888 (备注网络安全)**

**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**[需要这份系统化资料的朋友,可以点击这里获取](https://bbs.csdn.net/topics/618540462)**

**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PHP写得及时聊天工具,结构设计的很好,有源码。是学习PHP的好资料 JeCat-Jabber(简称:JJ) 是一款完全由 PHP 开发的即时通讯软件。JJ 采用 Gtk2 图像界面库来实现用户界面。顾名思义 JJ 使用 Jabber 协议(XMPP) ,因此可以 和 包括 GTalk 在内的 其它任何 XMPP 即时通讯软件 聊天。 JJ 项目的初衷在于 演示 桌面窗口 和 PHP 多任务处理,这两大 在长期在 PHP程序员 眼中 几乎是“不可能”的任务。 同时 也是 PHP框架 JCAT 的演示项目,JCAT 是一款同时 支持 Web 和 桌面 的 PHP框架,按照计划 将在稍后 发布。 JJ 的特点 > 跨平台。JJ 在Linxu 环境下 开发,在 Windows 平台上也一样可以正常使用。 > 实用 标准的 XMPP协议,能够与其它的 Jabber 软件互相通讯,例如 Google GTalk、Pidgin、PSI、Spark、Pandion,以及其它的 Jabber网页聊天窗口 > 可更换界面皮肤,皮肤样式文件 采用 类似 CSS 的语法,便于美工独立工作。 > 纯 PHP 实现,从 通讯协议 到 图形界面,全部都由 PHP 开发,如果你正好是一名 PHP 程序员,你可以驾轻就熟地在 JJ 之上进行二次开发。 > 可整合到你的网站中。JJ 近期的完善 会使 JJ 更容易地 为你的网站所有,让你的网站 也可以有像 淘宝旺旺 那样的 专用聊天工具 [ PHP 图像界面 ] JJ 采用 Gtk图像界面库,Gtk库 中 提供了丰富的 图形界面窗体(Widget),以及灵活方便的 窗体布局方式。 Gtk 本身 被广泛应用在 Linux 平台上,Linux 最著名 的桌面环境之一 Gnome 即是众多 Gtk软件 的集中展示。 PHP-Gtk2 将 Gtk 窗体绑定到 PHP 语言中,允许程序员 通过 PHP语言 来创建、显示、销毁 Gtk 窗体。PHP-Gtk 项目由 PHP创始人 亲自负责,并且自项目创立一来 一直持续发展,目前已经支持 最新的 Gtk2。 [ PHP 多任务处理 ] PHP 直到 5.2都没有提供 稳定可靠的 多线程特性。 但 PHP 仍然有能力进行多任务处理。 多线程 因为涉及到 线程安全、线程同步 等 困难,在 支持线程的语言中,也常常建议尽量避免使用。 Linux 的多路复用 是 更稳定和安全的 多任务模式,从 PHP5.0 开始 多路复用 支持 Windows 平台。
greenplum-db-6.2.1-rhel7-x86_64.rpm Pivotal Greenplum 6.2 Release Notes This document contains pertinent release information about Pivotal Greenplum Database 6.2 releases. For previous versions of the release notes for Greenplum Database, go to Pivotal Greenplum Database Documentation. For information about Greenplum Database end of life, see Pivotal Greenplum Database end of life policy. Pivotal Greenplum 6 software is available for download from the Pivotal Greenplum page on Pivotal Network. Pivotal Greenplum 6 is based on the open source Greenplum Database project code. Important: Pivotal Support does not provide support for open source versions of Greenplum Database. Only Pivotal Greenplum Database is supported by Pivotal Support. Release 6.2.1 Release Date: 2019-12-12 Pivotal Greenplum 6.2.1 is a minor release that includes new features and resolves several issues. New Features Greenplum Database 6.2.1 includes these new features: Greenplum Database supports materialized views. Materialized views are similar to views. A materialized view enables you to save a frequently used or complex query, then access the query results in a SELECT statement as if they were a table. Materialized views persist the query results in a table-like form. Materialized view data cannot be directly updated. To refresh the materialized view data, use the REFRESH MATERIALIZED VIEW command. See Creating and Managing Materialized Views. Note: Known Issues and Limitations describes a limitation of materialized view support in Greenplum 6.2.1. The gpinitsystem utility supports the --ignore-warnings option. The option controls the value returned by gpinitsystem when warnings or an error occurs. If you specify this option, gpinitsystem returns 0 if warnings occurred during system initialization, and returns a non-zero value if a fatal error occurs. If this option is not specified, gpinitsystem returns 1 if initialization completes with warnings, and returns value of 2 or greater if a fatal error occurs. PXF version 5.10.0 is included, which introduces several new and changed features and bug fixes. See PXF Version 5.10.0 below. PXF Version 5.10.0 PXF 5.10.0 includes the following new and changed features: PXF has improved its performance when reading a large number of files from HDFS or an object store. PXF bundles newer tomcat and jackson libraries. The PXF JDBC Connector now supports pushdown of OR and NOT logical filter operators when specified in a JDBC named query or in an external table query filter condition. PXF supports writing Avro-format data to Hadoop and object stores. Refer to Reading and Writing HDFS Avro Data for more information about this feature. PXF is now certified with Hadoop 2.x and 3.1.x and Hive Server 2.x and 3.1, and bundles new and upgraded Hadoop libraries to support these versions. PXF supports Kerberos authentication to Hive Server 2.x and 3.1.x. PXF supports per-server user impersonation configuration. PXF supports concurrent access to multiple Kerberized Hadoop clusters. In previous releases of Greenplum Database, PXF supported accessing a single Hadoop cluster secured with Kerberos, and this Hadoop cluster must have been configured as the default PXF server. PXF introduces a new template file, pxf-site.xml, to specify the Kerberos and impersonation property settings for a Hadoop or JDBC server configuration. Refer to About Kerberos and User Impersonation Configuration (pxf-site.xml) for more information about this file. PXF now supports connecting to Hadoop with a configurable Hadoop user identity. PXF previously supported only proxy access to Hadoop via the gpadmin Greenplum user. PXF version 5.10.0 deprecates the following configuration properties. Note: These property settings continue to work. The PXF_USER_IMPERSONATION, PXF_PRINCIPAL, and PXF_KEYTAB settings in the pxf-env.sh file. You can use the pxf-site.xml file to configure Kerberos and impersonation settings for your new Hadoop server configurations. The pxf.impersonation.jdbc property setting in the jdbc-site.xml file. You can use the pxf.service.user.impersonation property to configure user impersonation for a new JDBC server configuration. Note: If you have previously configured a PXF JDBC server to access Kerberos-secured Hive, you must upgrade the server definition. See Upgrading PXF in Greenplum 6.x for more information. Changed Features Greenplum Database 6.2.1 includes these changed features: Greenplum Stream Server version 1.3.1 is included in the Greenplum distribution. Resolved Issues Pivotal Greenplum 6.2.1 is a minor release that resolves these issues: 29454 - gpstart During Greenplum Database start up, the gpstart utility did not report when a segment instance failed to start. The utility always displayed 0 skipped segment starts. This issue has been resolved. gpstart output was also enhanced to provide additional warnings and summary information about the number of skipped segments. For example: [WARNING]:-********

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值