28. Implement strStr()
2016-03-18 21:44
211 查看
Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Subscribe to see which companies asked this question
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Subscribe to see which companies asked this question
public class Solution { public int strStr(String haystack, String needle) { int x = haystack.indexOf(needle); return x; } }
相关文章推荐
- 将任意类型转为number类型
- zjnu MAFIJA (图论)
- 朴素贝叶斯Naïve Bayes分类算法在Hadoop上的实现
- dfs和bfs
- xgboost[python版本]的安装
- 反思
- 指针数组和数组指针
- 软件开发-原型设计
- Uva 11395 - Sigma Function (算术基本定理)
- 67. Add Binary
- 【游戏外挂、修改器、辅助研究1】认识外挂
- asp循环遍历数据库ACCESS
- Hadoop HA(高可用)环境的搭建
- 7. Java 注释类型
- Exynos4412 中断驱动开发相关问题总结
- hibernate自动建表出现的问题
- 蓝桥杯 2015校内选拔试题 第六题:1/a 的分数称为单位分数
- redis 命令大全
- Leetcode 14 Longest Common Prefix
- Visual Studio 2013版本安装