Hackerrank Pangrams Algorithm Java Solution

- 1 min

Problem

Problem detail Hackerrank.

Java Solution

package com.caglar.hackerrank;

public class Pangrams {

    public static String pangrams(String s) {
        String str = s.toLowerCase();
        for (char c = 'a'; c <= 'z'; c++) {
            if (str.indexOf(c) < 0) return "not pangrams";
        }
        return "pangrams";
    }

    public static void main(String[] args) {
        System.out.println(pangrams("We promptly judged antique ivory buckles for the next prize"));
    }

}
Çağlar Eker

Çağlar Eker

Back-end Developer, Java