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

  • Home
  • SEARCH
  • 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 6047259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:19:53+00:00 2026-05-23T07:19:53+00:00

I am working on a project involving Dynamic Programming and am struck on this

  • 0

I am working on a project involving “Dynamic Programming” and am struck on this trivial thing, please help.

Suppose I take 4 as an input, I want to display something like: 0000 to 1111

But, if I input 5, I want to display like: 00000 to 11111 and so on.

Thanks in advance,

EDIT: Please don’t post asking me for the code. This is not a homework problem and I don’t need any code, just tell me the logic for it and I would be happy.

EDIT2: WTH is happening with Stackoverflow, did I ask any of you to write code for me? I want the person who downvoted to upvote it. What is a point of this forum if I can’t for help?

Share the logic with me. We can discuss and I do not require the code for this.

EDIT3: Here I am posting the code which I tried. I hope this “SATISFIES” all the people who were thinking I have not tried anything.

import java.util.ArrayList;

public class RegularInvestigator {

public ArrayList createCombinations(ArrayList listOfFlightNumbers) {

ArrayList<String> result = new ArrayList<String>();

for(int i = 1; i < listOfFlightNumbers.size(); i++) {

  String binaryEqvivalent = Integer.toBinaryString(i);System.out.println(binaryEqvivalent);
  String element = "";

  for(int j = 0; j < binaryEqvivalent.length(); j++)
    if(binaryEqvivalent.charAt(j) == '1')
      element += listOfFlightNumbers + " ";

  result.add(element.substring(0, element.length() - 1));
}

return result;

}

private String getContent(ArrayList<String> flight) {
String temp = "";

for(int i = 0; i < flight.size() - 1; i++)  temp += flight.get(i) + " ";

temp += flight.get(flight.size() - 1);

return temp;

}

private ArrayList removeElementAtIndex(ArrayList flight, int position) {

ArrayList<String> res = new ArrayList<String>();

for(int i = 0; i < flight.size(); i++) {
  if(i != position) res.add(flight.get(i));
}

return res;

}
}

EDIT4: Thank you phoxis, PengOne, Jerry Coffin and oliholz for your valuable answers 🙂

  • 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-05-23T07:19:53+00:00Added an answer on May 23, 2026 at 7:19 am
    • Get input n
    • Count from i=0 to (2^n) - 1
    • for each value of i bitmask each bit of i and display.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on project involving c programming for my mathematics course at university. I
I'm working on a simple project involving sockets. Kinda like telnet. I just want
I'm working on project where I have fieldset #a like this. <fieldset id=a> <input
I am looking for an open-source project involving c++ GUI(s) working with a database.
I’m working a project involving datamining from various sites, a good analogy is gathering
I'm working on a project involving enlisting a large number of relatively unskilled workers
I'm working on a project involving some large XML files (from 50MB to over
I am working on a project involving optimizing energy consumption within a system. Part
I’m working on a project involving Vignette as the CMS. Does anyone know if
I am working on a project involving large amount of data from the delicious

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.