Questions tagged [pangram]

A pangram is a piece of text that contains every letter of the alphabet at least once. "Quick fox jumps nightly above wizard."

40 questions
10
votes
9 answers

Javascript Pangram Regex

I am trying to write a REGEX to test for a PANGRAM. I can do it the traditional way, but cannot seem to solve it for more than 90% of my tests with a regular expression. Input: string Output: true || false function isPangram(string){ return…
Vontei
  • 1,727
  • 2
  • 14
  • 16
10
votes
15 answers

How to check if string is a pangram?

I want to create a function which takes a string as input and check whether the string is pangram or not (pangram is a piece of text which contains every letter of the alphabet). I wrote the following code, which works, but I am looking for an…
user2604985
7
votes
4 answers

How would you write a program to find the shortest pangram in a list of words?

Given a list of words which contains the letters a-z at least once, how would you write a program to find the shortest pangram counted by number of characters (not counting spaces) as a combination of the words? Since I am not sure whether short…
jonathanasdf
  • 2,844
  • 2
  • 23
  • 26
4
votes
8 answers

How to detect a pangram

A pangram is a sentence that contains every single letter of the alphabet at least once. Here is my code so far: const isPangram = (string) => { let alpha = string.toUpperCase().split(""); for (let beta = 65; beta < 65 + alpha.length;…
hbagley
  • 63
  • 2
  • 6
4
votes
3 answers

Is it possible to generate Pangram from given word list?

Pangram is a sentence using every letter of the alphabet at least once. Is it possible to generate shortest Pangram from given word list? Lets say, I have word list like this cat monkey temp banana christmas fast quick quickest jumping white brown…
YOU
  • 120,166
  • 34
  • 186
  • 219
3
votes
3 answers

Finding how many different letters there are in a string in Python

I'm very new to Python 3 and programming for that matter. I trying to find an algorithm to find out when a sentence is a pangram. I've solved that side of the bargain thanks to a function with the aid of the string module, but I also need to find…
Denny Nuyts
  • 165
  • 2
  • 12
2
votes
2 answers

RegExp "i" case insensitive VS toLowerCase() (javascript)

I'm hoping someone can explain to me why I need to use "toLowerCase()" if I'm already using a regular expression that is case insensitive "i". The exercise is a pangram that can accept numbers and non-ascii characters, but all letters of the…
Veronica
  • 45
  • 5
2
votes
5 answers

Efficient Java language constructs to check if string is pangram?

So far, i have came up with this. I have tried to minimize string operations and isolate solution to built in data types, arrays and integer operations. I'm in search of much more elegant way to check for a pangram string, in java. Elegant, as in…
alkber
  • 1,426
  • 2
  • 20
  • 26
2
votes
7 answers

How do I check if a string contains ALL letters of the alphabet in python?

I am trying to write a python program that checks if a given string is a pangram - contains all letters of the alphabet. Therefore, "We promptly judged antique ivory buckles for the next prize" should return True while any string that does not…
Maslor
  • 1,821
  • 3
  • 20
  • 44
2
votes
3 answers

String contains character bash

In bash, I'm trying to test whether a sentence is a pangram. read sentence if [[ "$sentence" == [Aa] && [Bb] && [Cc] && [Dd] && [Ee] && [Ff] && [Gg] && [Hh] && [Ii] && [Jj] && [Kk] && [Ll] && [Mm] && [Nn] && [Oo] && [Pp] && [Qq] && [Rr] && [Ss] &&…
Quill
  • 2,729
  • 1
  • 33
  • 44
1
vote
2 answers

I need to check if a string is a pangram string or not is my code correct?

public static class Inova { public static bool IsPangram(string str) { int compteur = 26; for (int i = 0; i <= str.Length; i++) { if (('A' <= str[i] && str[i] <= 'Z') || ('a' <= str[i] && str[i] <=…
1
vote
5 answers

Pangram in C using functions

When I input The quick brown fox jumps over the lazy dog, the following program prints not a pangram. Yet, I expect s to be 26 and printf("pangram") to be executed. What am I doing wrong? #include #include #include…
1
vote
3 answers

Using regular expression to check for pangram in a string error

Roy wanted to increase his typing speed for programming contests. His friend suggested that he type the sentence "The quick brown fox jumps over the lazy dog" repeatedly. This sentence is known as a pangram because it contains every letter of the…
and1
  • 307
  • 2
  • 10
1
vote
1 answer

Errors in Python Pangram Checker on Exercism.io

I am trying to solve this problem on Exercism.io's Python track and am passing all tests except tests for mixed case and punctuation, only lower case, numbers, and underscores. There are 10 tests and I currently have four incorrect. Here's my…
Jordan Williams
  • 181
  • 2
  • 10
1
vote
5 answers

Pangram using hashset in java

i am trying to determine whether the string is pangram or not by using set in Java I've tried the below code.Now the output is showing as not pangram but it should be a pangram. Pls tell me whats wrong in my solution // Java Program to…
1
2 3