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 8921463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:32:58+00:00 2026-06-15T06:32:58+00:00

(C++! I didn’t know if I should mention it or not) (Keep the order

  • 0

(C++! I didn’t know if I should mention it or not)
(Keep the order if at all possible!)

Say I have, and I do, the string ABaC.

I have each character in that string in a vector called temp.

So I have temp[0] = A, temp[1] = B, temp[3] = a, temp[4] = C.

What I would like to do is right a program that outputs every permutation of that string, that results from removing 0 capital letters, then 1 capital letter, then two capital letters, then all 3.

The reason I’m removing capitals is… you shouldn’t focus on capitals. It happened that I needed to remove all the capitals here but , for let’s say ADbd, I don’t need to remove D. So really, an algorithm for removing a set of already known characters from a string.

So it would output:

ABaC|BaC|AaC|ABa|aC|Aa|Ba|a

Not looking for efficiency here or too brilliant of an algorithm. Something simple and long or short and stupid I am more than happy with as well.

This is part of an ongoing project i’m working on that removes lambda productions (which you fine folk helped me with already) So this is the step where I need to construct the new production rules by removing the nullable variables from the rule, one by one, and so on and output every permutation.

But, y’all can ignore that bit. Think of it just as the string. So, any help is greatly appreciated.

Thank ya kindly.

  • 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-15T06:32:59+00:00Added an answer on June 15, 2026 at 6:32 am

    I’m not sure what language you’re working with, so I’ve provided the high-level steps below.

    1. Walk through your string and create a set capitalIndexes of all the indicies at which capital letters exist.
    2. For each set s in the powerset of capitalIndexes, print out each character of the string except for the those located at an index in s, then print \n.

    The only complicated bit here is generating the powerset; here is another answer that provides a means of doing this in C++.

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

Sidebar

Related Questions

Didn't know how else to put this. Say I have a JavaScript method that
I didn't find anywhere whether is possible to query from Db4o all objects implementing
Didn't really know how to title this. First time writing a gem so not
Didn't have this issue at all until I began adapting my app for iOS
I didn't really know how to phrase this question, its quite strange. I have
Didn't know how to word the title sorry. Basically I have a comments system,
It didn't have a project and I removed myself as the assignee, now I
I didn't find an answer to this question because I don't know if I'm
I didn't face this error before. I have a database db , that contains
I didn’t found short form for this question as subject… Is it possible to

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.