Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:55:50+00:00 2026-06-18T07:55:50+00:00

Consider the set of 26 alphabet and 10 digits. Write a function which returns

  • 0

Consider the set of 26 alphabet and 10 digits.

Write a function which returns the numbers of passwords of length N containing at-least L lowercase letters, at-least U uppercase letters and at-least D digits.

Function Signature int cntPass(int N,int L,int U,int D)

My approach:

I was trying to use recursion to solve it but I think its wrong.My (wrong) recurrence was as follows:

f(N,L,U,D)=f(N,L-1,U,D)+f(N,L,U-1,D)+f(N,L,U,D-1) [with the necessary base conditions but it didnt work].

I am looking for a better approach or a different logic to solve this problem.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:55:52+00:00Added an answer on June 18, 2026 at 7:55 am

    This is just a simple combinatorics problem. The result is NCL * N-LCU * N-L-UCD * 26L * 26U * 10D * 62N – U – L – D, which can be simplified a bit to 26L + U * 10D * 62N – U – L – D * N! / ( U! * L! * D! * (N – L – U – D)! ).

    We choose L places for the lower case characters among N places. Then choose U places for upper case letters among the rest N – L places. And choose D places for digits among the rest N – L – U places. The rest are anything goes.

    L lower case letters have 26 choices each. Same for U upper case letters. D digits have 10 choices each. For the rest (N – L – U – D), we can use any of 26 + 26 + 10 characters for each of them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following case: void Set(const std::function<void(int)> &fn); void Set(const std::function<void(int, int)> &fn); Now
Consider a managed object with a set of properties A which have to be
Consider a hidden set of k random numbers {r1,r2...rk} chosen with uniform probability distribution
Consider the following setup: There a 2 physical servers which are set up as
Consider the set of strings S that contains the binary representation of the numbers
Consider the following: set.seed(1) RandData <- rnorm(100,sd=20) Locations <- rep(c('England','Wales'),each=50) today <- Sys.Date() dseq
Consider following script: SET LANGUAGE 'German' GO SET DATEFIRST 1 GO DECLARE @FullDate DATETIME
consider am declaring a variable avar as Set avar; then ,i initialized as avar=
Consider this class: class test { public function __set($n, $v) { echo __set() called\n;
Consider the requirement to find a matched pair of set of characters, and remove

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.