class Solution { public: bool isPalindrome(string s) { int i = 0, j = s.length() - 1; while (i < j) { if (!isalnum(s[i])) i++; else if (!is... ...
分类:
其他好文 时间:
2018-05-20 15:25:51
阅读次数:
116
本文简单介绍如何引入validation的步骤,如何通过自定义validation减少代码量,提高生产力。特别提及:非基本类型属性的valid,GET方法的处理,validation错误信息的统一resolve。 ...
分类:
编程语言 时间:
2018-05-19 23:25:54
阅读次数:
314
LeetCode第20题 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is ...
分类:
编程语言 时间:
2018-05-19 21:30:44
阅读次数:
171
问题链接 "LeetCode 367. Valid Perfect Square" 题目解析 判断一个正数是否是完全平方数,不可使用sqrt函数。 解题思路 这是一道简单题,但是却挺有思考价值的。本题有很多种解法,思路各异,可以都看看。 无数种解法 解法一 数学里有一个概念叫做等差数列,完全平方数恰 ...
分类:
其他好文 时间:
2018-05-18 00:37:14
阅读次数:
185
题目描述: X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different from X. Each digit must be ...
分类:
其他好文 时间:
2018-05-17 00:55:06
阅读次数:
166
由于是本地yum源安装软件,无法联网,因此使用yum安装软件时报了错,解决方法是: 打开vi /etc/resolv.conf文件 新增内容如下: nameserver 8.8.8.8 nameserver 4.2.2.2 nameserver 172.19.0.6 nameserver 172.1 ...
分类:
Web程序 时间:
2018-05-15 22:53:18
阅读次数:
184
*无法联网的明显表现会有: 1、yum install出现 Error: cannot find a valid baseurl or repo:base 2、ping host会提示unknown host 方法一、 1、打开 vi /etc/sysconfig/network-scripts/i ...
分类:
Web程序 时间:
2018-05-12 17:33:32
阅读次数:
685
题目描述: Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Example 2: Note: 要完成的函数 ...
分类:
其他好文 时间:
2018-05-12 02:42:33
阅读次数:
169
Invalid escape sequence (valid ones are \b \t \n \f \r \" \' \\ ) \b \t \n \f \r \" \' 网上很多自己看介绍吧 字符串中有[] split("[\\[\\]]") 字符串中有{} split("[\\[\\]]") ...
分类:
其他好文 时间:
2018-05-10 15:43:14
阅读次数:
169
Form验证 第一种操作:主要是这三个函数 is_valid() cleaned_data errors <form action="/xiaoqing/form/" method="post"> {% csrf_token %} {# {% for row in error_dict.keys % ...
分类:
其他好文 时间:
2018-05-07 17:36:57
阅读次数:
147