Skip to content

Missing Test Case - 2598. Smallest Missing Non-negative Integer After Operations #32945

@shaikh631

Description

@shaikh631

LeetCode Username

ayan_9819

Problem Number, Title, and Link

https://leetcode.com/problems/smallest-missing-non-negative-integer-after-operations/submissions/1803627202

Bug Category

Problem description

Bug Description

  1. Smallest Missing Non-negative Integer After Operations

Language Used for Code

Java

Code used for Submit/Run operation

class Solution {
    public int findSmallestInteger(int[] nums, int value) {
        int[] freq = new int[value];
        for (int a : nums) {
            int r = ((a % value) + value) % value;
            freq[r]++;
        }
        int x = 0;
        while (true) {
            int r = x % value;
            if (freq[r] == 0) return x;
            freq[r]--;
            x++;
        }
    }
}

Expected behavior

6
ms
Beats
84.77%

Screenshots

Image

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions