https://oj.leetcode.com/problems/add-binary/http://blog.csdn.net/linhuanmars/article/details/20192227publicclassSolution{
publicStringaddBinary(Stringa,Stringb){
StringBuildersb=newStringBuilder();
char[]charsA=a.toCharArray();
char[]charsB=b.toCharArray(..
分类:
其他好文 时间:
2015-01-04 11:35:00
阅读次数:
156
https://oj.leetcode.com/problems/merge-two-sorted-lists/http://blog.csdn.net/linhuanmars/article/details/19712593/**
*Definitionforsingly-linkedlist.
*publicclassListNode{
*intval;
*ListNodenext;
*ListNode(intx){
*val=x;
*next=null;
*}
*}
*/
publicclassSolu..
分类:
其他好文 时间:
2015-01-04 11:34:49
阅读次数:
147
https://oj.leetcode.com/problems/plus-one/http://blog.csdn.net/linhuanmars/article/details/22365957publicclassSolution{
publicint[]plusOne(int[]digits){
if(digits==null||digits.length==0)
returnnull;
booleancarry=true;
for(inti=digits.length-1;i>=0;i--..
分类:
其他好文 时间:
2015-01-04 11:33:38
阅读次数:
130
题目1001:A+B for Matrices
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:14669
解决:5996
题目描述:
This time, you are supposed to find A+B where A and B are two matrices, and then count the num...
分类:
其他好文 时间:
2015-01-04 01:18:51
阅读次数:
202
题目1002:Grading
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:15686
解决:4053
题目描述:
Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a...
分类:
其他好文 时间:
2015-01-04 01:18:50
阅读次数:
178
#include
#include
#include
using namespace std;
int main()
{
int chArray[26] ;
memset(chArray, 0, 26*sizeof(int));
int N =0;
string s;
cin>> N;
while (N--)
{
memset(chArray, 0, 26*sizeof(i...
分类:
其他好文 时间:
2015-01-03 21:06:15
阅读次数:
241
#include
#include
#include
using namespace std;
int main()
{
string s;
cin>>s;
sort(s.begin(), s.end());
cout
return 0;
}...
分类:
其他好文 时间:
2015-01-03 21:05:36
阅读次数:
146
题目:Sort a linked list using insertion sort.代码:oj测试通过Runtime:860 ms 1 # Definition for singly-linked list. 2 # class ListNode: 3 # def __init__(sel...
分类:
编程语言 时间:
2015-01-03 21:03:14
阅读次数:
208
【LeetCode】Excel sheet column title输入非负整数n,输出以下格式:1 -> A2 -> B......26 -> Z27 -> AA28 -> AB[分析]实质是将十进制转换为26进制。应该想到用string的+运算,可以连接字符。利用函数reverse(result...
分类:
其他好文 时间:
2015-01-03 17:12:53
阅读次数:
91
https://oj.leetcode.com/problems/sudoku-solver/http://blog.csdn.net/linhuanmars/article/details/20748761publicclassSolution{
publicvoidsolveSudoku(char[][]board){
resolve(board,0,0);
}
privatebooleanresolve(char[][]b,//currentboard
inti,//currentrow
intj)/..
分类:
其他好文 时间:
2015-01-03 13:24:47
阅读次数:
155