Skip to content
CampusEduX

Elements Appearing More Than N/K Times

Mediumjavapythonccppjavascript

Given an array of N elements and an integer K, find every value that occurs more than N / K times (integer division).

Input Format

The first line contains two integers N and K. The second line contains N space-separated integers.

Output Format

Print the qualifying values in increasing order, separated by single spaces. If there are none, print an empty line.

Related Problems

  • Zero Sum Subarray
    Medium · java, python, c, cpp, javascript
    Solve Problem
  • Longest Subarray with Sum K
    Medium · java, python, c, cpp, javascript
    Solve Problem
  • Longest Consecutive Sequence
    Medium · java, python, c, cpp, javascript
    Solve Problem

Input (stdin)

Output

Run your code to see output here...