Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
1
Task/Palindrome-detection/J/palindrome-detection-1.j
Normal file
1
Task/Palindrome-detection/J/palindrome-detection-1.j
Normal file
|
|
@ -0,0 +1 @@
|
|||
isPalin0=: -: |.
|
||||
4
Task/Palindrome-detection/J/palindrome-detection-2.j
Normal file
4
Task/Palindrome-detection/J/palindrome-detection-2.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
isPalin0 'ABBA'
|
||||
1
|
||||
isPalin0 -.&' ' tolower 'In girum imus nocte et consumimur igni'
|
||||
1
|
||||
6
Task/Palindrome-detection/J/palindrome-detection-3.j
Normal file
6
Task/Palindrome-detection/J/palindrome-detection-3.j
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
isPalin1=: 0:`($:@(}.@}:))@.({.={:)`1:@.(1>:#)
|
||||
|
||||
isPalin2=: monad define
|
||||
if. 1>:#y do. 1 return. end.
|
||||
if. ({.={:)y do. isPalin2 }.}:y else. 0 end.
|
||||
)
|
||||
12
Task/Palindrome-detection/J/palindrome-detection-4.j
Normal file
12
Task/Palindrome-detection/J/palindrome-detection-4.j
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
foo=: foo,|.foo=:2000$a.
|
||||
ts=:6!:2,7!:2 NB. time and space required to execute sentence
|
||||
ts 'isPalin0 foo'
|
||||
2.73778e_5 5184
|
||||
ts 'isPalin1 foo'
|
||||
0.0306667 6.0368e6
|
||||
ts 'isPalin2 foo'
|
||||
0.104391 1.37965e7
|
||||
'isPalin1 foo' %&ts 'isPalin0 foo'
|
||||
1599.09 1164.23
|
||||
'isPalin2 foo' %&ts 'isPalin0 foo'
|
||||
3967.53 2627.04
|
||||
Loading…
Add table
Add a link
Reference in a new issue