14 challenges match these filters
isAvailable(item) should be true only when the item is in stock AND not discontinued.
Logic error
safe_ratio(a, b) should return True when a / b is greater than 1, and False when b is zero rather than crashing.
Logic error
largest_gap(nums) should return the biggest jump between consecutive values in an ascending list, so largest_gap([1, 5, 6]) returns 4.
Logic error
all_positive(nums) should return True only when EVERY number is greater than zero.
Logic error
percentChange(oldValue, newValue) should report the change as a percentage of the old value. Going from 100 to 150 is +50.
Logic error
checkout(total, pct) should apply a percentage discount, so checkout(200, 50) returns 100.
Logic error
cartTotal(items) should total price x quantity for every item, so two of a 10 unit item plus one of a 5 unit item is 25.
Logic error
groupByLength(words) should group words by their length, so ["ab","cd","x"] gives {"1":["x"],"2":["ab","cd"]}.
Logic error
count_words(text) should count the words in a string, however much whitespace separates them.
Logic error
is_leap_year(year) should return True for leap years: divisible by 4, except centuries, unless divisible by 400.
Logic error
grade(score) should return "A" for 90+, "B" for 80-89, "C" for 70-79, "D" for 60-69, and "F" below 60.
Logic error
qualifiesForFreeShipping(total) should return true when the order total is 50 or more — spending exactly 50 qualifies.
Logic error
isEven(n) should return true if n is even, false otherwise.
Logic error
can_checkout(cart_total, has_valid_payment) should return True only when the cart has items AND payment is valid.
Logic error