Detect Pangram(js练习题codewars)

A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence "The quick brown fox jumps over the lazy dog" is a pangram, because it uses the letters A-Z at least once (case is irrelevant).

Given a string, detect whether or not it is a pangram. Return True if it is, False if not. Ignore numbers and punctuation.

javascript 复制代码
function isPangram(string){
  let abc = 'abcdefghijklmnopqrstuvwxyz'
  let arr = abc.split('');
  str = string.toLowerCase()
  for(let c of str){
    let idx = arr.indexOf(c)
    if(idx > -1){
      arr.splice(idx,1)
    }
    
    if(arr.length == 0){
      return true
    }
  }
  return false
}
相关推荐
yuzhiboyouye几秒前
VO一般java后端怎么转换成前端想要的数据
java·前端·状态模式
数据库小学妹3 分钟前
企业级数据库迁移实践:从Oracle到国产数据库的兼容性与实施策略
数据库·mysql·oracle·dba
2301_779622413 分钟前
PHP处理Codex安全漏洞检测【解答】
jvm·数据库·python
一 乐4 分钟前
学院教学工作量统计|基于java+ vue学院教学工作量统计管理系统(源码+数据库+文档)
java·数据库·vue.js·spring boot·论文·毕设·学院教学工作量统计系统
六月雨滴7 分钟前
Oracle 安全架构概述
数据库·oracle·dba·安全架构
迷藏4948 分钟前
【无标题】
java·数据库·oracle
莽撞的大地瓜16 分钟前
政企舆情大数据服务平台:新浪舆情通以技术赋能全流程管理
大数据·数据库·数据分析
weixin_4597539421 分钟前
c++如何利用filesystem--relative计算两个文件之间的相对路径【详解】
jvm·数据库·python
小脑斧12322 分钟前
从范式重构到工程落地:OpenTiny NEXT 引领前端智能化新范式
前端·hermesagent·opentiny next
小江的记录本22 分钟前
【AI大模型选型指南】《2026年5月(最新版)国内外主流AI大模型选型指南》(企业版)
前端·人工智能·后端·ai作画·aigc·ai编程·ai写作