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. 迷你DVD管理器(Java版)

    import java.text.SimpleDateFormat;import java.util.Date;import java.util.Scanner;class Test {    pub ...

  2. Yii2 AR find用法 (2016-05-18 12:06:01)

    Yii2 AR find用法 (2016-05-18 12:06:01) 转载▼     User::find()->all();    返回所有数据   User::findOne($id); ...

  3. intellij idea使用配置jetty maven 插件

    pom.xml中更改或则添加: <build> <finalName>mall</finalName> <plugins> <plugin> ...

  4. Silverlight管理系统源代码(SilverlightOAFlame开发框架主要提供二次开发)

    Silverlight OA系统简介 系统功能简介 l 程序界面介绍: 左侧为主菜单,主菜单可以展开和收起,主菜单下面的所有模块都可以在数据库中扩展增加,模块的权限和用户角色挂钩,可以在数据库中创建多 ...

  5. [uboot]E9-i.MX6Q-uboot移植

      参照:http://blog.csdn.net/girlkoo/article/details/45420977 文档参照: <i.MX BSP Porting Guide-2015/12, ...

  6. jmf找不到摄像头设备解决办法

    1.安装的jdk需要时32位的. 2.在jmfregistry中注册捕获设备. 3.jar文件必须和配置文件在一起.可以新建User library把jar文件添加进去.

  7. 使用Maven构建多模块项目

    [转] 使用Maven构建多模块项目 在平时的Javaweb项目开发中为了便于后期的维护,我们一般会进行分层开发,最常见的就是分为domain(域模型层).dao(数据库访问层).service(业务 ...

  8. Intellij IDEA的激活

    选server激活,填http://www.iteblog.com/idea/key.php即可 现在改为http://idea.iteblog.com/key.php

  9. ubuntu Server 14 自动更新

    https://help.ubuntu.com/stable/serverguide/automatic-updates.html http://spin.atomicobject.com/2014/ ...

  10. 16.检查是否为BST

    题目描述 请实现一个函数,检查一棵二叉树是否为二叉查找树. 给定树的根结点指针TreeNode* root,请返回一个bool,代表该树是否为二叉查找树 import java.util.*; /* ...