sir Brute force is work class Solution { public int maxProfitAssignment(int[] difficulty, int[] profit, int[] worker) { // int j = 0; int res = 0; List arr = new ArrayList(); for (int i = 0; i < worker.length; i++) { int pro = 0; for (int j = 0; j < difficulty.length; j++) { if (worker[i] >= difficulty[j]) { pro = Math.max(pro, profit[j]); } } arr.add(pro); } for(int i=0;i
@CodingBlocksIndia4 ай бұрын
Brute force is working fine because of easy constraints..!!