Java-Solutions-TCS-Xplore-Proctored-Assessment icon indicating copy to clipboard operation
Java-Solutions-TCS-Xplore-Proctored-Assessment copied to clipboard

if condition wrong

Open kumarqwe opened this issue 1 year ago • 1 comments

///where the limit int is lesser than or equal to the original array of Inventory object's threshold attribute.

public static Inventory[] replenish(Inventory[] inventories, int limit){ Inventory[] refined = new Inventory[0]; for (int i = 0; i < inventories.length; i++){ if (inventories[i].getThreshold() <= limit){ ///// change to (inventory[i].getThreshold() >= limit) refined=Arrays.copyOf(refined, refined.length+1); refined[refined.length-1] = inventories[i]; } } return refined; }

kumarqwe avatar Jun 24 '23 15:06 kumarqwe

Hey @kumarqwe, Glad you found this issue. Would you be willing to raise a PR for this?

venkivijay avatar Jun 26 '23 11:06 venkivijay