Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

deleted 250 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38

Japt, (削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

###Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0

##8-byte Solution: õ å+ è\U

###Explanation: õ å+ è\U õ // Create a range from [1...Input] å+ // Cumulative reduce by addition è // Return the number of occurrences where: \U // Item == Input

##10-byte Solution:


õ å+ aU >JøU

Try it online!

###Explanation: õ å+ aU >JøU õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aUøU // Return the last index ofDoes it contain the input >J // > -1?

Try it online!

Japt, (削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

###Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0

##8-byte Solution: õ å+ è\U

###Explanation: õ å+ è\U õ // Create a range from [1...Input] å+ // Cumulative reduce by addition è // Return the number of occurrences where: \U // Item == Input

##10-byte Solution:

õ å+ aU >J

Try it online!

###Explanation: õ å+ aU >J õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aU // Return the last index of the input >J // > -1

Japt, (削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

###Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0


õ å+ øU

###Explanation: õ å+ øU õ // Create a range from [1...Input] å+ // Cumulative reduce by addition øU // Does it contain the input?

Try it online!

added 269 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38

Japt, (削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

##Explanation###Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0

###10##8-byte Solution: õ å+ è\U

###Explanation: õ å+ è\U õ // Create a range from [1...Input] å+ // Cumulative reduce by addition è // Return the number of occurrences where: \U // Item == Input

##10-byte Solution:

õ å+ aU >J

Try it online!

##Explanation###Explanation: õ å+ aU >J õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aU // Return the last index of the input >J // > -1

Japt, (削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

##Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0

###10-byte Solution:

õ å+ aU >J

Try it online!

##Explanation: õ å+ aU >J õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aU // Return the last index of the input >J // > -1

Japt, (削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

###Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0

##8-byte Solution: õ å+ è\U

###Explanation: õ å+ è\U õ // Create a range from [1...Input] å+ // Cumulative reduce by addition è // Return the number of occurrences where: \U // Item == Input

##10-byte Solution:

õ å+ aU >J

Try it online!

###Explanation: õ å+ aU >J õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aU // Return the last index of the input >J // > -1

added 188 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38

Japt, 10(削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

##Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0

###10-byte Solution:

õ å+ aU >J

Try it online! Try it online!

##Explanation: õ å+ aU >J õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aU // Return the last index of the input >J // > -1

After we cumulatively reduce the range [1...Input] by addition, we check to see if the Input exists in that range.

Japt, 10 bytes

õ å+ aU >J

Try it online!

##Explanation: õ å+ aU >J õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aU // Return the last index of the input >J // > -1

After we cumulatively reduce the range [1...Input] by addition, we check to see if the Input exists in that range.

Japt, (削除) 10 (削除ここまで) 7 bytes

Saved 3 bytes thanks to @Luke and @ETHproductions

*8Ä ¬v1

Try it online!

##Explanation: *8Ä ¬v1 ¬ // Square root of: *8 // Input * 8 Ä // +1 v1 // Return 1 if divisible by 1; Else, return 0

###10-byte Solution:

õ å+ aU >J

Try it online!

##Explanation: õ å+ aU >J õ // Create a range from [1...Input] å+ // Cumulative reduce by addition aU // Return the last index of the input >J // > -1

deleted 1 character in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading
deleted 1 character in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading
deleted 51 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading

AltStyle によって変換されたページ (->オリジナル) /