Skip to main content
added 48 characters in body; edited body
Source Link

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               6
  ‘    - Increment                            7
    L  - Length of the input                  7 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

If the output values can be any 2 distinctconsistent values, then QL_L works, which outputs -1 for truthy and -2any other non-positive number for falsey. (thanks @JonathanAllan)

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               6
  ‘    - Increment                            7
    L  - Length of the input                  7 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

If the output values can be any 2 distinct values, then QL_L works, which outputs -1 for truthy and -2 for falsey.

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               6
  ‘    - Increment                            7
    L  - Length of the input                  7 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

If the output values can be any consistent values, then QL_L works, which outputs -1 for truthy and any other non-positive number for falsey (thanks @JonathanAllan)

added 122 characters in body
Source Link

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               6
  ‘    - Increment                            7
    L  - Length of the input                  7 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

If the output values can be any 2 distinct values, then QL_L works, which outputs -1 for truthy and -2 for falsey.

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               6
  ‘    - Increment                            7
    L  - Length of the input                  7 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               6
  ‘    - Increment                            7
    L  - Length of the input                  7 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

If the output values can be any 2 distinct values, then QL_L works, which outputs -1 for truthy and -2 for falsey.

added 2 characters in body
Source Link

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               56
  ‘    - Increment                            67
    L  - Length of the input                  67 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,7,9]
 L     - Length                               5
  ‘    - Increment                            6
    L  - Length of the input                  6 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1

Jelly, 8 5 bytes

QL‘=L

Try it online!

Explanation

QL‘=L  - Main link, argument L (a list)   e.g [1,6,3,4,4,7,9]
Q      - Deduplicated elements                [1,6,3,4,7,9]
 L     - Length                               6
  ‘    - Increment                            7
    L  - Length of the input                  7 ([1,6,3,4,4,7,9])
   =   - Are they equal?                      1
added 379 characters in body
Source Link
Loading
Source Link
Loading