Skip to main content

Posts

Showing posts from January, 2022

Password checker problem

Problem :  Implement a function name checkPassword(String str, int len, int min). The function will accept a string str and its length len and another argument min which denotes minimum length of the password. You are supposed to print valid, if the password meets the criteria given below or invalid if the password doesn't meet the criteria mentioned below: - at least of min characters. - at least one numeric digit. - at least one capital letter. - at least one special character. - must not have space or + - starting character must not be a number.  Java Solution : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System. in ); String str = sc. next (); int min = sc. nextInt (); System. out . println (checkPassword(str, str. length (), min)); } public stati