top of page

992. Subarrays with K Different Integers

Brute force Approach

start adding the element into the set from index 0 to last index

For the below example

set values = < 1 >

check if set size = k increase count by 1

count = 1


here i = 0 (index)

ree

i = 1 (index)

ree

i = 2 (index)

ree

i = 3 (index)


set values = [2,3]

increase count by 1

count = count + 1

count = 7


So the final Answer is 7

Recent Posts

See All

Comments


Call 

7869617359

Email 

Follow

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram
Never Miss a Post. Subscribe Now!

Thanks for submitting!

bottom of page