- 博客(4)
- 收藏
- 关注
原创 替换字符串中连续出现的指定字符串
本题来自《程序员代码面试指南》(左程云)著题目:给定三个字符串str,from,to,已知from字符串中无重复字符,把str中所有的from字符串替换为to字符串,然后替换后的字符串。举例:str="123abc",from="abc",to="456",return "123456";import java.io.*;class test { public static v
2016-03-31 14:19:18
1672
原创 Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node./** * Definition for a binary t
2016-03-31 10:24:44
228
原创 求字符串中数字之和
本题来自左成云所著《程序员代码面试指南》,欢迎大家购买此书,很值得推荐。 要求 1.忽略小数点字符,例如“a1.3”,其中包含两个数字1和3。 2.如果紧贴数字字符串左侧有‘-’出现,当连续出现的次数为奇数时,数字视为负数,如果连续出现的次数为偶数时,数字视为正数。例如:“a-123dfd–345”,其中包含连个数字-123和345。 举例 str=”a
2016-03-31 10:09:00
3071
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人