Skip to main content
added 2 characters in body
Source Link
Luis Mendo
  • 106.8k
  • 10
  • 139
  • 382

MATL, 5 bytes

:i\~z 

Input isInputs are a cell array containing the start and end values, and then a column vector defining list.

Try it online! Or verify all test cases.

Explanation

: % Range, with implicit input: cell array {start, end}. This gives the range % from start to end i % Input: list of numbers in the form of a column vector \ % Modulo, with boradcast. This gives a matrix with each number in the range % modulo each number in the list ~ % Logical negation z % Number of nonzero entries. Implicit display 

MATL, 5 bytes

:i\~z 

Input is a cell array containing the start and end values, and then a column vector defining list.

Try it online! Or verify all test cases.

Explanation

: % Range, with implicit input: cell array {start, end}. This gives the range % from start to end i % Input: list of numbers in the form of a column vector \ % Modulo, with boradcast. This gives a matrix with each number in the range % modulo each number in the list ~ % Logical negation z % Number of nonzero entries. Implicit display 

MATL, 5 bytes

:i\~z 

Inputs are a cell array containing the start and end values, and then a column vector defining list.

Try it online! Or verify all test cases.

Explanation

: % Range, with implicit input: cell array {start, end}. This gives the range % from start to end i % Input: list of numbers in the form of a column vector \ % Modulo, with boradcast. This gives a matrix with each number in the range % modulo each number in the list ~ % Logical negation z % Number of nonzero entries. Implicit display 
added 416 characters in body
Source Link
Luis Mendo
  • 106.8k
  • 10
  • 139
  • 382

MATL, 5 bytes

:i\~z 

Input is a cell array containing the start and end values, and then a column vector defining list.

Try it online! Or verify all test cases.

Explanation

: % Range, with implicit input: cell array {start, end}. This gives the range % from start to end i % Input: list of numbers in the form of a column vector \ % Modulo, with boradcast. This gives a matrix with each number in the range % modulo each number in the list ~ % Logical negation z % Number of nonzero entries. Implicit display 

MATL, 5 bytes

:i\~z 

Input is a cell array containing the start and end values, and then a column vector defining list.

Try it online! Or verify all test cases.

MATL, 5 bytes

:i\~z 

Input is a cell array containing the start and end values, and then a column vector defining list.

Try it online! Or verify all test cases.

Explanation

: % Range, with implicit input: cell array {start, end}. This gives the range % from start to end i % Input: list of numbers in the form of a column vector \ % Modulo, with boradcast. This gives a matrix with each number in the range % modulo each number in the list ~ % Logical negation z % Number of nonzero entries. Implicit display 
Source Link
Luis Mendo
  • 106.8k
  • 10
  • 139
  • 382

MATL, 5 bytes

:i\~z 

Input is a cell array containing the start and end values, and then a column vector defining list.

Try it online! Or verify all test cases.