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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:30:42+00:00 2026-05-23T15:30:42+00:00

I need some advice. I know how to solve this problem clumsily, but I

  • 0

I need some advice. I know how to solve this problem clumsily, but I want to do it the right way, as I need to impress someone for a potential internship.

I have a textfile, for example:

[XXX622] [YYY]  [LLL]   [E77700]  [NNN]  [6JL99NNN] [HH66]  [0770LLL]  [R88] [VVV]
[B177HQ] [8RR22]   [PPP]  [GGG]  [CCXXXGG]   [8IIXX0] [3KCC]   [00222]
[222] [OO] [OO] [OO] [99]   [555444]   [33]

I need to read the entries and then do processes with them, for example sort alphabetically.

The process I don’t know how to do is counting how many similar entries are in each line.

If I read the entries into a string array and pass the array to the counting method, then how should I make it so the method knows from which line each entry is? Should I create a 2D array and insert the linenumber along with the entry into it as a string?

Thanks in advance!

  • 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-23T15:30:42+00:00Added an answer on May 23, 2026 at 3:30 pm

    Here’s a hint.

    Use a Map (some concrete implementation thereof; HashMap would work) when you process the line. If you know how to insert an entry into a Map, and if you know how to tell if an entry already exists in the Map, you have your solution!

    If you really want to impress them explain to them why the Map solution is fast and then also explain the speed vs. memory trade-offs. Using Big-O notation will impress them more and will also show that you know what you’re talking about.

    I’m not going to give you the entire (working) solution since you said this was for an internship. If your intent is to impress them, you should work out the solution yourself. Presenting a community solution as your own would be a little dishonest, in my opinion.

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

Sidebar

Related Questions

Does someone know a fast way to invoke shader processing via DirectX? Right now
Need some help or some advice with entity framework v4. As you already know,
I need some advice on how to tackle an algorithmic problem (ie. not programming
Afternoon all, In need of some technical advice from the masters... I know the
I need some advice when it comes to solving a sorting algorithm. This particular
I need some advice as to how I easily can separate test runs for
I need some expect advice on how to handle the following:- I have a
i have a input tag which is non editable, but some times i need
I'm tinkering with Akka and need some advice how to implement something specific i
I realize there are several solutions to this problem. I am looking for advice

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.