function fearNotLetter(str) {
//return str;
var arr = str.split('');
var temp = [];
var start = str.charCodeAt(0);
var end = str.charAt(str.length - 1).charCodeAt(0);
for(var i = start; i < end + 1; i++){
var item = String.fromCharCode(i);
if(arr[0] !== item){
temp.push(item);
}else{
arr.shift();
}
}
if(temp.length === 0){
return undefined;
}else{
return temp.join('');
}
} fearNotLetter("abce");

  

Missing letters的更多相关文章

  1. FCC-学习笔记 Missing letters

    FCC-学习笔记  Missing letters 1>最近在学习和练习FCC的题目.这个真的比较的好,推荐给大家. 2>中文版的地址:https://www.freecodecamp.c ...

  2. freeCodeCamp:Missing letters

    从传递进来的字母序列中找到缺失的字母并返回它. 如果所有字母都在序列中,返回 undefined. function fearNotLetter(str) { var arr = str.split( ...

  3. Missing letters-freecodecamp算法题目

    Missing letters 1.要求 从传递进来的字母序列中找到缺失的字母并返回它. 如果所有字母都在序列中,返回 undefined. 2.思路 设定缺失变量miss 在for循环遍历字符串的各 ...

  4. 2076 Problem F Quick Brown Fox

    题目描述 A pangram is a phrase that includes at least one occurrence of each of the 26 letters, ‘a’. . . ...

  5. FreeCodeCamp 中级算法(个人向)

    freecodecamp 中级算法地址戳这里 Sum All Numbers in a Range 我们会传递给你一个包含两个数字的数组.返回这两个数字和它们之间所有数字的和. function su ...

  6. Codeforces Round #372 (Div. 2) B

    Description ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists ...

  7. Codeforces Round #372 (Div. 2) A B C 水 暴力/模拟 构造

    A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...

  8. Codeforces 716B Complete the Word【模拟】 (Codeforces Round #372 (Div. 2))

    B. Complete the Word time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  9. Complete the Word CodeForces - 716B

    ZS the Coder loves to read the dictionary. He thinks that a word is nice if there exists asubstring  ...

随机推荐

  1. 解决Maven项目编译时提示:源值1.5已过时,将在未来所有版本中删除

    每次编译项目时,都提示:源值1.5已过时,将在未来所有版本中删除 查了一些资料,发现是因为IDEA默认把项目的源代码版本设置为jdk1.5,目标代码设置为jdk1.5 解决方案:  修改Maven的S ...

  2. selenium多个窗口切换

    浏览器里面支持多窗口打开,例如这样: html里面写了: target="_blank" 造成新打开一个窗口,但是selenium不会自动跳转到新的串口,需要自己切换: # 你打开 ...

  3. 【C】 03 - 数据类型

    程序说到底就是对数据的处理,所以首先要弄清楚需要处理哪些数据,计算机如何存储这些数据.C语言根据需要,抽象出了一些基本数据类型和衍生数据类型.这些可以满足大部分需求,更复杂的抽象数据类型亦可通过它们来 ...

  4. SQL阻塞原因造成系统多功能无响应的分析解决思路

    最近遇到一个sqlserver项目,月底会出现多个财务相关功能出现不定期操作无响应问题 通过查询SQL阻塞信息,定位到阻塞源头spid.该会话的状态.等待事件及执行的SQL脚本 根据spid查询该会话 ...

  5. Dictionary<TKey, TValue> 类

    C# Dictionary<TKey, TValue> 类 Dictionary<TKey, TValue> 泛型类提供了从一组键到一组值的映射.字典中的每个添加项都由一个值及 ...

  6. Java中Enum类型的序列化(转)

    在Java中,对Enum类型的序列化与其他对象类型的序列化有所不同,今天就来看看到底有什么不同.下面先来看下在Java中,我们定义的Enum在被编译之后是长成什么样子的. Java代码: Java代码 ...

  7. 001_JavaScript 错误 - Throw、Try 和 Catch

    try 语句测试代码块的错误. catch 语句处理错误. throw 语句创建自定义错误. 错误一定会发生 当 JavaScript 引擎执行 JavaScript 代码时,会发生各种错误: 可能是 ...

  8. Nginx基本配置

    1.Nginx官网下载安装程序,http://nginx.org/ 2.启动命令 启动:start nginx.exe停止:nginx -s stop 重新加载: nginx -s reload 3. ...

  9. php读取zip文件(删除文件,提取文件,增加文件)实例

    <?php /* php 从zip压缩文件中提取文件 */ $zip = new ZipArchive; if ($zip->open('jQuery五屏上下滚动焦点图代码.zip') = ...

  10. 华为OJ题目:扑克牌大小

    题目描述: 扑克牌游戏大家应该都比较熟悉了,一副牌由54张组成,含3~A.2各4张,小王1张,大王1张.牌面从小到大用如下字符和字符串表示(其中,小写joker表示小王,大写JOKER表示大王):3  ...