Skip to main content
deleted 19 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it doesn't contains zeros, and is falsy if it contains at least a zero.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*)(*) are neither necessary nor harmful, and have been included only to make the string contining the source code non-discriminating.

q     % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=    % Square matrix of all pairwise equality comparisons
s     % Sum of each column. Gives a row vector
q     % Subtract 1 from each value. An entry equal to 0 indicates the input string
      % is discriminating because some character appears only once
t     % Duplicate
&=    % Square matrix of all pairwise equality comparisons. An entry equal to 0
      % indicates the input string is discriminating because some character is
      % more repeated than some other
t     % Duplicate (*)
s     % Sum of each column (*) (all those sums will be positive if the previous
      % matrix doesn't contain zeros)
v     % Vertically concatenate the matrix and the vector of its column sums
v     % Vertically concatenate the resulting matrix with nothing (*)
      % Implicit display

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it doesn't contains zeros, and is falsy if it contains at least a zero.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*) are neither necessary nor harmful, and have been included only to make the string contining the source code non-discriminating.

q     % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=    % Square matrix of all pairwise equality comparisons
s     % Sum of each column. Gives a row vector
q     % Subtract 1 from each value. An entry equal to 0 indicates the input string
      % is discriminating because some character appears only once
t     % Duplicate
&=    % Square matrix of all pairwise equality comparisons. An entry equal to 0
      % indicates the input string is discriminating because some character is
      % more repeated than some other
t     % Duplicate (*)
s     % Sum of each column (*) (all those sums will be positive if the previous
      % matrix doesn't contain zeros)
v     % Vertically concatenate the matrix and the vector of its column sums
v     % Vertically concatenate the resulting matrix with nothing (*)
      % Implicit display

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it doesn't contains zeros, and is falsy if it contains at least a zero.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*) are neither necessary nor harmful, and have been included only to make the source code non-discriminating.

q     % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=    % Square matrix of all pairwise equality comparisons
s     % Sum of each column. Gives a row vector
q     % Subtract 1 from each value. An entry equal to 0 indicates the input string
      % is discriminating because some character appears only once
t     % Duplicate
&=    % Square matrix of all pairwise equality comparisons. An entry equal to 0
      % indicates the input string is discriminating because some character is
      % more repeated than some other
t     % Duplicate (*)
s     % Sum of each column (*) (all those sums will be positive if the previous
      % matrix doesn't contain zeros)
v     % Vertically concatenate the matrix and the vector of its column sums
v     % Vertically concatenate the resulting matrix with nothing (*)
      % Implicit display
added 42 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it doesn't contains zeros, and is falsy if it contains at least a zero.

Try it online! Or verify all test casesverify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*) are neither necessary nor harmful, and have been included only to make the string contining the source code non-discriminating.

q     % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=    % Square matrix of all pairwise equality comparisons
s     % Sum of each column. Gives a row vector
q     % Subtract 1 from each value. An entry equal to 0 indicates the input string
      % is discriminating because some character appears only once
t     % Duplicate
&=    % Square matrix of all pairwise equality comparisons. An entry equal to 0
      % indicates the input string is discriminating because some character is
      % more repeated than some other
t     % Duplicate (*)
s     % Sum of each column (*) (all those sums will be positive if the previous
      % matrix doesn't contain zeros)
v     % Vertically concatenate the matrix and the vector of its column sums
v     % Vertically concatenate the resulting matrix with nothing (*)
      % Implicit display

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it doesn't contains zeros, and is falsy if it contains at least a zero.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*) are neither necessary nor harmful, and have been included only to make the string contining the source code non-discriminating.

q    % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=   % Square matrix of all pairwise equality comparisons
s    % Sum of each column. Gives a row vector
q    % Subtract 1 from each value. An entry equal to 0 indicates the input string
     % is discriminating because some character appears only once
t    % Duplicate
&=   % Square matrix of all pairwise equality comparisons. An entry equal to 0
     % indicates the input string is discriminating because some character is
     % more repeated than some other
t    % Duplicate (*)
s    % Sum of each column (*) (all those sums will be positive if the previous
     % matrix doesn't contain zeros)
v    % Vertically concatenate the matrix and the vector of its column sums
v    % Vertically concatenate the resulting matrix with nothing (*)
     % Implicit display

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it doesn't contains zeros, and is falsy if it contains at least a zero.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*) are neither necessary nor harmful, and have been included only to make the string contining the source code non-discriminating.

q     % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=    % Square matrix of all pairwise equality comparisons
s     % Sum of each column. Gives a row vector
q     % Subtract 1 from each value. An entry equal to 0 indicates the input string
      % is discriminating because some character appears only once
t     % Duplicate
&=    % Square matrix of all pairwise equality comparisons. An entry equal to 0
      % indicates the input string is discriminating because some character is
      % more repeated than some other
t     % Duplicate (*)
s     % Sum of each column (*) (all those sums will be positive if the previous
      % matrix doesn't contain zeros)
v     % Vertically concatenate the matrix and the vector of its column sums
v     % Vertically concatenate the resulting matrix with nothing (*)
      % Implicit display
added 14 characters in body
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it is non-empty and doesn't contains zeros, and is falsy otherwiseif it contains at least a zero.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*) are neither necessary nor harmful, and have been included only to make the string contining the source code non-discriminating.

q    % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=   % Square matrix of all pairwise equality comparisons
s    % Sum of each column. Gives a row vector
q    % Subtract 1 from each value. An entry equal to 0 indicates the input string
     % is discriminating because some character appears only once
t    % Duplicate
&=   % Square matrix of all pairwise equality comparisons. An entry equal to 0
     % indicates the input string is discriminating because some character is
     % more repeated than some other
t    % Duplicate (*)
s    % Sum of each column (*) (all those sums will be positive if the previous
     % matrix doesn't contain zeros)
v    % Vertically concatenate the matrix and the vector of its column sums
v    % Vertically concatenate the resulting matrix with nothing (*)
     % Implicit display

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a matrix, which is truthy if it is non-empty and doesn't contains zeros, and is falsy otherwise.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

MATL, 12 bytes

q&=sqt&=tsvv

The input is a string enclosed in single quotes. Single quotes in the string are escaped by duplicating.

The output is a non-empty matrix, which is truthy if it doesn't contains zeros, and is falsy if it contains at least a zero.

Try it online! Or verify all test cases, including the standard truthiness/falsiness test for convenience.

How it works

Statements marked with (*) are neither necessary nor harmful, and have been included only to make the string contining the source code non-discriminating.

q    % Implicit input. Convert chars to code points and subtract 1 from each (*)
&=   % Square matrix of all pairwise equality comparisons
s    % Sum of each column. Gives a row vector
q    % Subtract 1 from each value. An entry equal to 0 indicates the input string
     % is discriminating because some character appears only once
t    % Duplicate
&=   % Square matrix of all pairwise equality comparisons. An entry equal to 0
     % indicates the input string is discriminating because some character is
     % more repeated than some other
t    % Duplicate (*)
s    % Sum of each column (*) (all those sums will be positive if the previous
     % matrix doesn't contain zeros)
v    % Vertically concatenate the matrix and the vector of its column sums
v    % Vertically concatenate the resulting matrix with nothing (*)
     % Implicit display
Source Link
Luis Mendo
  • 105.3k
  • 9
  • 135
  • 372
Loading