India’s Best Job Seekers and Training Platform Forums Algorithm Solutions Discussion Can you break the given string into words …

  • Can you break the given string into words …

  • Akash 

    Administrator
    at

    Can you break the given string into words, provided by a given hashmap of frequency of word as <word: n>

    Example:

    HashMap -> {“abc”:3, “ab”:2, “abca”:1}

    String: abcabcabcabca

    output: Yes; [ abc, abc, abc , abca ]

    Example:

    HashMap -> {“abc”:3, “ab”:2}

    String: abcabab

    output: No

    Example:

    HashMap -> {“abc”:3, “ab”:2, “abca”:1}

    String: abcx

    output: No

Log in to reply.

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

New Report

Close