33
>>
>> 111222333111222333111222333
>>
>> 123123123123123123123123123
>>
>> $A
>>
>> 3 27
>>
>>
>>
>> Find a way to separate all rows and columns with spaces so you can apply “.
>> To turn the characters to a 3
way to separate all rows and columns with spaces so you can apply “.
> To turn the characters to a 3 27 array of jntegers.
>
> .
>
> Linda
>
>
> AOL Mobile Mail
>
>
> -Original Message-
>
> From: Cliff Reiter
> To: programming
> Sent: Tue, Oct
liff Reiter
To: programming
Sent: Tue, Oct 3, 2017 11:21 PM
Subject: Re: [Jprogramming] Quora Digits Problem
A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114
1115 1116 1121 1122 1123 1124 On 10/3/2017 4:16 PM, Skip
ile Mail
-Original Message-
From: Cliff Reiter
To: programming
Sent: Tue, Oct 3, 2017 11:21 PM
Subject: Re: [Jprogramming] Quora Digits Problem
A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114
1115 1116 11
11:21 PM
Subject: Re: [Jprogramming] Quora Digits Problem
A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114
1115 1116 1121 1122 1123 1124 On 10/3/2017 4:16 PM, Skip Cave wrote: > Another interesting Quora proble
s with spaces so you can apply “. To
turn the characters to a 3 27 array of jntegers.
.
Linda
AOL Mobile Mail
-Original Message-
From: Cliff Reiter
To: programming
Sent: Tue, Oct 3, 2017 11:21 PM
Subject: Re: [Jprogramming] Quora Digits Problem
A cheat (?) that builds instead of &q
Hi all!
3!:0 ,+// (|.10^i.4)*/>:i.6
8
The floor operation was not redundant.
Marshalls
,+// (10<.@^i._4)*/>:i.6
can be written
,+// (<.10^i._4)*/>:i.6
,but the floor operation is needed to produce integers.
20 {. ,+// (<.10^i._4)*/>:i.6
1112 1113 1114 1115 1116 1121 1122 1
Not ugly!
$,+// (|.10^i.4)*/>:i.6
1296
Linda
Sent from AOL Mobile Mail
On Wednesday, October 4, 2017 Cliff Reiter wrote:
I was stunned to see how fast, and on pausing, how beautiful Marshall's were.
Very unusual and powerful uses of insert. > I doubt you'll find a much faster J
solution th
I was stunned to see how fast, and on pausing, how beautiful Marshall's
were. Very unusual and powerful uses of insert.
I doubt you'll find a much faster J solution than:
,(+/~10&*)/ 4#,:>:i.6
or the uglier but slightly quicker
,+// (10<.@^i._4)*/>:i.6
But the problem is structural, not numer
I was stunned by Cliff's cool use of catalog (catalogue?) I had not really
grasped the capabilities of the monadic use of '{' on boxed arguments. I
had always used { dyadically as 'from'
2 { 1 2 3
3
This was a revelation:
{2#<'123'
┌──┬──┬──┐
│11│12│13│
├──┼──┼──┤
│21│22│23│
├──┼
Yes... I was going to post another version (rather like Don Quinn's:
10#.1+6#.inv i.6^4), but it couldn't approach Marshall's
implementations in terms of efficiency, so did not seem worth posting.
And then Don posted his.
Generally speaking Marshall's approach (which keeps results small
until the
Nice! No need to invent a number.
Linda
Sent from AOL Mobile Mail
On Tuesday, October 3, 2017 Cliff Reiter wrote:
A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z
1112 1113 1114 1115 1116 1121 1122 1123 1124
On 10/3/2017 4:16 PM, Skip Cave wrote: > Anoth
Hi all !
I think Marshalls second method was dead cool. This is the Mike Day
problem solved with that method.
,}.+//(10<.@^i._2)*/(i.10)-.2 4 5 9
10 11 13 16 17 18 30 31 33 36 37 38 60 61 63 66 67 68 70 71 73 76 77 78
80 81 83 86 87 88
Cheers,
Erling
Den 2017-10-04 kl. 12:20, skrev 'M
I've only just seen this thread, so little to offer, except to point
out that
the same approach may be used for this modified problem, which is how I
misread it
to start with:
"... remove all integers that contain certain digits, eg 2 4 5 9"
Then Marshall's method may be adapted fairl
Hi all!
I was a bit curious, so I ran some tests.
ts=: 6!:2 , 7!:2@]
NB. Raul
RaulResult=. (#~ 1- +./@e.&'7890'@":"0) 1000+i.8999
NB. Jimmy
JimmyResult=.(3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y') 1000+i.8999
NB. Marshall1
Marshall1Result =. ,(+/~10&*)/ 4#,:>:i.6
NB.
Wow! brilliant solutions! It will take me a couple of days to parse through
these diverse approaches to solving the Digits problem. One of the aspects
of J that I appreciate the most is the wide range of creative approaches
that seem to materialize when multiple people use J to solve the same
probl
Variant on the cheat:
zz=.,10#.>{4#<>:i.6
4{.zz
1112 1113 1114
On Tue, Oct 3, 2017 at 11:24 PM, Roger Hui
wrote:
> V. nice.
>
> As they say, if you're not cheating you are not trying hard enough. :-)
>
>
> On Tue, Oct 3, 2017 at 8:21 PM, Cliff Reiter
> wrote:
>
> > A cheat (?) that
V. nice.
As they say, if you're not cheating you are not trying hard enough. :-)
On Tue, Oct 3, 2017 at 8:21 PM, Cliff Reiter wrote:
> A cheat (?) that builds instead of "removing"
>
>z=.,".>{4#<'123456'
>$z
> 1296
>10{.z
> 1112 1113 1114 1115 1116 1121 1122 1123 1124
>
>
> On
A cheat (?) that builds instead of "removing"
z=.,".>{4#<'123456'
$z
1296
10{.z
1112 1113 1114 1115 1116 1121 1122 1123 1124
On 10/3/2017 4:16 PM, Skip Cave wrote:
Another interesting Quora problem:
Given the integers from 1000 to , remove all integers that contain a 7,
8, 9
Carelessness on my part.
Thanks,
--
Raul
On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui wrote:
> Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense.
>
>
> On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote:
>
>> Something like this?
>>
>>(#~ 1- +./@e.&'7890'@":"0) 1000+i.8999
>
10#.>:6 6 6 6#:i.6^4
On Tue, Oct 3, 2017 at 3:00 PM, Jimmy Gauvin wrote:
>ff=: 3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y'
>
>$ff 1000+i.9000
>
> 1296
>
>$ff 1000+i.5667
>
> 1296
>
> On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui
> wrote:
>
> > Why 1000+i.8999? 1000+i.6000 or 1000+
I doubt you'll find a much faster J solution than:
,(+/~10&*)/ 4#,:>:i.6
or the uglier but slightly quicker
,+// (10<.@^i._4)*/>:i.6
Marshall
On Tue, Oct 03, 2017 at 03:16:41PM -0500, Skip Cave wrote:
> Another interesting Quora problem:
>
> Given the integers from 1000 to , remove all in
ff=: 3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y'
$ff 1000+i.9000
1296
$ff 1000+i.5667
1296
On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui wrote:
> Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense.
>
>
> On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote:
>
> > Somethi
Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense.
On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote:
> Something like this?
>
>(#~ 1- +./@e.&'7890'@":"0) 1000+i.8999
>
> Thanks,
>
> --
> Raul
>
>
> On Tue, Oct 3, 2017 at 4:16 PM, Skip Cave wrote:
> > Another interesting Q
Something like this?
(#~ 1- +./@e.&'7890'@":"0) 1000+i.8999
Thanks,
--
Raul
On Tue, Oct 3, 2017 at 4:16 PM, Skip Cave wrote:
> Another interesting Quora problem:
>
> Given the integers from 1000 to , remove all integers that contain a 7,
> 8, 9, or zero, and list the remaining integer
Another interesting Quora problem:
Given the integers from 1000 to , remove all integers that contain a 7,
8, 9, or zero, and list the remaining integers.
Skip
--
For information about J forums see http://www.jsoftware.com/fo
26 matches
Mail list logo