Intresting Online Assesment problem

Revision en1, by akshit5638, 2024-07-13 20:42:10

we have an array of size n.each element of array is between 1 and 10.we are also given an integer k.We can divide array in atmost k subsets.After dividing, each element should belong to exactly one subset.We have to tell if it is possible to divide such that every subset sum<=10

constraints:

test case,t<=100

n<=1000

1<=a[i]<=10

1<=k<=100

example

t=1

n=12

2 1 2 5 4 3 6 1 1 9 3 2

k=4

than a valid division is

[9,1],[6,1,3],[5,2,3],[4,2,2,1]

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English akshit5638 2024-07-13 20:42:10 535 Initial revision (published)