摘要: 编写一个函数来查找字符串数组中的最长公共前缀。 如果不存在公共前缀,返回空字符串 ""。 示例 1: 输入: ["flower","flow","flight"]输出: "fl"示例 2: 输入: ["dog","racecar","car"]输出: ""解释: 输入不存在公共前缀。 来源:力扣(L 阅读全文
posted @ 2019-09-21 21:16 biu~biu~biu~ 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 方法一:reverse函数 方法二:采用切片 阅读全文
posted @ 2019-09-20 22:12 biu~biu~biu~ 阅读(2234) 评论(0) 推荐(0) 编辑
摘要: 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb"输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。示例 2: 输入: "bbbbb"输出: 1解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。示例 3: 阅读全文
posted @ 2019-09-20 16:48 biu~biu~biu~ 阅读(141) 评论(0) 推荐(0) 编辑
摘要: https://www.patest.cn/contests/gplt/L1-006 一个正整数N的因子中可能存在若干连续的数字。例如630可以分解为3*5*6*7,其中5、6、7就是3个连续的数字。给定任一正整数N,要求编写程序求出最长连续因子的个数,并输出最小的连续因子序列。 输入格式: 输入在 阅读全文
posted @ 2017-03-20 19:14 biu~biu~biu~ 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 3 #define StackSize 100 4 #define OK 1 5 #define ERROR 0 6 #define TRUE 1 7 #define FALSE 0 8 9 typedef int ElemType; 10 typede 阅读全文
posted @ 2016-11-14 21:00 biu~biu~biu~ 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 typedef int ElementType; 5 typedef struct Node { 6 ElementType data; 7 struct Node *next; 8 }Lnode,*Lin 阅读全文
posted @ 2016-11-14 20:58 biu~biu~biu~ 阅读(571) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 4 typedef char Elemtype; 5 6 typedef struct node 7 { 8 Elemtype data; 9 struct node *next; 10 }Lnode,*Linkl 阅读全文
posted @ 2016-11-14 20:56 biu~biu~biu~ 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 4 #define OVERFLOW 0 5 typedef char Elemtype; 6 typedef struct TreeNode 7 { 8 Elemtype data; 9 struct TreeN 阅读全文
posted @ 2016-11-14 20:49 biu~biu~biu~ 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1285 Description 有N个比赛队(1<=N<=500),编号依次为1,2,3,。。。。,N进行比赛,比赛结束后,裁判委员会要将所有参赛队伍从前往后依次排名,但现在裁判委员会不能直接 阅读全文
posted @ 2016-08-23 16:07 biu~biu~biu~ 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/problemset/problem/567/B Description Berland National Library has recently been built in the capital of Berland. In additio 阅读全文
posted @ 2016-08-23 11:07 biu~biu~biu~ 阅读(270) 评论(0) 推荐(0) 编辑