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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:35:30+00:00 2026-05-25T18:35:30+00:00

I have a list which contains numeric strings. The numeric strings in list may

  • 0

I have a list which contains numeric strings. The numeric strings in list may start with any number from 1 to 9 (it doesn’t start with “0”). Now i need to find three top occurrences in the list.

Ex:
1234
2345
2343
4356
6434
2343
2222
4545
6666
6653

top three occurrences in the above list respectively are 2,6,4.

  • 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-25T18:35:31+00:00Added an answer on May 25, 2026 at 6:35 pm
    int occurences[10];  // Store numbers occurences in number index 
    

    For example if occurence of 5 is equal to 6 then occurences[5] = 6

    Second thing you must do is write a function to get count of occurences.

    int occurence(int number) 
    {
         int i=0;
         for(;i<listSize;i++) {
            if(atoi(myList[i]) == number)
                 occurences[number]++;
         }
    }
    

    The last thing you must do is find the biggest 3 element in occurences array.

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

Sidebar

Related Questions

I have an List<int> which contains 1,2,4,7,9 for example. I have a range from
I have a Python list with a number of entries, which I need to
I have a list which contains a number of things: lista = ['a', 'b',
I have list in SML, which contains members from datatype expr (list b). I
I have an undordered list Aditya Sam which contains the names of people from
I have a list which contains strings integers and floats. I want to convert
example, suppose I have one list which contains 45 element so from which i
I have a List which contains dates from June 1, 2009 to June 1,
i have a list which contains sentences split up from a test paragraph. I'm
I have a list which contains a number of _MEMORY_BASIC_INFORMATION structs nested within mb

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.