Ad

-6 bytes

  1. Removed spaces around comparison
  2. Used len() instead of count
Code
Diff
  • def solution(l):return 2<=len(([1 for p in l if p is True]))
    • def solution(l):return 2 <= ([1 for p in l if p is True]).count(1)
    • def solution(l):return 2<=len(([1 for p in l if p is True]))

Minus 7

How many times can you subtract 7 from a given number?

Examples

numMinusSeven(1000) === 143;
numMinusSeven(100) === 15;
numMinusSeven(10) === 2;
Code
Diff
  • function numMinusSeven(num) {
        return Math.ceil(num / 7)
    }
    
    • function numMinusSeven(num) {
    • let arr = []
    • while (num > 0) {
    • num -= 7
    • arr.push(num)
    • }
    • return arr.length
    • return Math.ceil(num / 7)
    • }