`
vvaaiinn
  • 浏览: 21048 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论
文章列表
题目: Reverse digits of an integer. Example1:x = 123, return 321 Example2:x = -123, return -321 翻译就是把一个数字反过来输出。 解题思路:这道题目看起来比较简单。无非就是一个数字取个位,作为另一个高位。无非是在10的运算。 代码1: public static int reverse2(int x) { int rev = 0; boolean flag = false;//正负数 if(x < 0) { x = 0 -x; flag ...
题目: The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G Y I R And then read line by line:"PAHNAPLSIIGYIR" Write the ...
忽然找到一位关于此题详细介绍的大牛文章。 转载之,以后常回顾一下。 http://www.cnblogs.com/tenosdoit/p/3675788.html 表示没学过动态规划,闲下来时候研究研究。 算法4挺别出心裁,值得学习! 题目链接 Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest palindromic su ...
题目:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest palindromic substring. 翻译:求字符串的最长回文子串 思路:既然是求最长回文串,那么就找到每一个回文串,然后把最长的长度标记处理就好。 但是回文串会有奇数位和偶数位,所以要分情况去求最大长度。
刚才偶然看见某前辈在github搭建了自己的blog。 觉得有些炫酷,顿时想搞一个试试。 想想自己许些日子前注册 过的github的帐号,但是却一份都代码都没传过,只是fork了别人的代码学习学习。惭愧惭愧。 于是在实验室的电脑配置msysgit,打算开始github之路 结果遇到了问题。 遂google一下。找到了一个不错的解决办法、 http://stackoverflow.com/questions/7144811/git-ssh-error-connect-to-host-bad-file-number 中文的意思大致就是在你的id_rsa的相同目录下添加个config文件 ...
题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 看到题目,首先想到的是 把2个数组合并成一个,然后在去中间位置的数字。 后来发现时间复杂度为O(m+n);与题目不符合。 找了一些前辈的解题思路后自己模仿写了一个解法,并附上自己的理解。 代码: public class Solution { ...
题目: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length ...
趁着还有热情,接着刷。 题目: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input:(2 -> 4 -> 3) + (5 -> 6 -> 4)Output:7 -> 0 - ...
大学学了一堆理论,编码水平渣。果然应该刷刷题了。 正好最近看java ,试着就java写一写。 水平略渣。。 题目: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less t ...
最近这个项目要求读取新闻,或者审批投递。显示却要像网页一样。 说白了就是左侧的标题和右侧的内容一一对应的gridview的格式显示。 安卓才看了10多天而已。苦苦折磨,没有做出一个好效果。 后来想想,是不是可以用和C#一样的girdview来显示。 但是手机不能像电脑一样设置明显的边框。 找了一些解决方案,不是十分满意。最后有了一个自我感觉可以的办法。 效果图: 原理其实就是利用gridview的表项和背景颜色的不同,来造成边框的样子。 具体代码如下: <!-- spdetailitem-> <?xml version="1.0& ...
今天把写好的网站部署到本地的IIS服务器上。出现了 System.Data.SqlClient.SqlException: 无法打开登录所请求的数据库 "ERP"。登录失败 的错误 百度一下解决方法,发现好多人都遇到了这样的错误。但是大部分的解决方法都是不好使。 如上图的错误。 最后终于在某学长的帮助下找到了解决方法。 具体方法如下: 1.打开数据库企业管理器,然后选择数据库---安全性---登录名----找到刚才报错的哪个''IIS APPOOOL\XXXXX'' --双击; 2. 点击用户映射,把你的访问的数据库勾上勾,并在下面的角色成员身份 ...
今天在帮学长做一个项目的下手的时候、 第一次遇见ModalPopupExtender这个控件、于是在经一番研究后、终于会基本使用、 现整理一些ModalPopupExtender该控件的相关知识、希望对asp.net初学者有帮助。 常用属性: TargetControlID:用于触发弹出面板的控件。 OkControlID:弹出面板中的确认按钮,用于确认新的样式。 OnOkScript:当单击确认按钮后,关闭样式面板后,执行脚本。 CancelControlID:样式面板中的取消按钮,用于取消应用样式。 PopupDragHandleControlID:样式面 ...
当在asp.net中运用到web用户控件的时候、明明一切都是按书上敲 结果出现了如上的界面、 百度一下发现在验证控件也会出现类似的问题。 特发下解决办法、 打开web。config 如果没有 <appSettnings> <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" /> </appSettnings> 则添加一个。 如你的里面有、且是 <appSettings> <ad ...
第一种方法:正则表达式<span style="white-space:pre"> </span>Regex numRegex = new Regex(@"^\d+$"); string id = Request.QueryString["Id"]; if (numRegex.IsMatch(id)) { // id 为纯数字。。 ...
Global site tag (gtag.js) - Google Analytics