India’s Best Job Seekers and Training Platform Forums Algorithm Solutions Discussion Find the first N words with the highest frequency …

  • Find the first N words with the highest frequency …

  • Akash 

    Administrator
    at

    Find the first N words with the highest frequency in an array of strings. The result needs to be sorted by frequency.

    For example:

    An array of String:

    Inputs:

    {“computer”, “for”, “a”, “portal”, “to”, “learn”, “can”, “be”, “computer”, “science”, “zoom”, “yup”, “fire”, “in”, “be”, “data”,”computer”}

    and the first 2 words with the highest frequency.

    Outputs: {computer, be}

    where computer has a frequency of 3 and be has a frequency of 2

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
KodNest Training New Batch is starting on 19th October 2020. Attend one week free demo classes.Register Now

New Report

Close