How many Jimmys can fit?Will Jimmy fall off his platform?Balancing WordsMove platforms!How can I get a repdigit?Turn a string inside outCan this list be balanced?How many shufflesHow many semitonesRosencrantz and Guildenstern are CodeCan this container hold this much liquid?Will Jimmy fall off his platform?
How did Einstein know the speed of light was constant?
comparing two addresses
My professor has told me he will be the corresponding author. Will it hurt my future career?
How to deal with a Murder Hobo Paladin?
I'm feeling like my character doesn't fit the campaign
Are "confidant" and "confident" homophones?
Passwordless authentication - how invalidate login code
Can a USB hub be used to access a drive from two devices?
Do I need transit visa for Dublin?
What is the fundamental difference between catching whales and hunting other animals?
How to find the version of extensions used on a Joomla website without access to the backend?
How many Jimmys can fit?
Does a Globe of Invulnerability spell block outsiders from teleporting inside with a spell?
How predictable is $RANDOM really?
How complicated can a finite double complex over a field be?
Why is there paternal, for fatherly, fraternal, for brotherly, but no similar word for sons?
Wearing special clothes in public while in niddah- isn't this a lack of tznius?
Do grungs have a written language?
Who goes first? Person disembarking bus or the bicycle?
Taking advantage when HR forgets to communicate the rules
White's last move?
Is this standard Japanese employment negotiations, or am I missing something?
Taking my Ph.D. advisor out for dinner after graduation
Is there a standard definition of the "stall" phenomena?
How many Jimmys can fit?
Will Jimmy fall off his platform?Balancing WordsMove platforms!How can I get a repdigit?Turn a string inside outCan this list be balanced?How many shufflesHow many semitonesRosencrantz and Guildenstern are CodeCan this container hold this much liquid?Will Jimmy fall off his platform?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /
, o
, and arranged like this
/o
Platforms are represented with -
. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform.
Some examples:
/o
- -------
Jimmy will balance since all their body parts are above a -
.
/o
------ ---
Jimmy will balanced since two body parts are above -
s.
/o
-- ---- --
Jimmy will balance even though they are split between two platforms
/o
-
Jimmy will not balanced since two body parts are not above a platform.
Your task is to write a program that takes a platform as a lengthed container containing only -
s and s (e.g. a string) and outputs the number of Jimmys that can be placed on the platform such that none of them will fall and none of them will overlap. A Jimmy may have one of their body parts to the left of the beginning of the string or the right of the end of the string.
This is code-golf so answers are scored in bytes with fewer bytes being the aim.
Test cases
Inputs
- - -
- -
--
-- --
----
- -- --
------- -
Respective outputs
0
0
1
1
2
2
2
3
code-golf string
$endgroup$
add a comment |
$begingroup$
In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /
, o
, and arranged like this
/o
Platforms are represented with -
. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform.
Some examples:
/o
- -------
Jimmy will balance since all their body parts are above a -
.
/o
------ ---
Jimmy will balanced since two body parts are above -
s.
/o
-- ---- --
Jimmy will balance even though they are split between two platforms
/o
-
Jimmy will not balanced since two body parts are not above a platform.
Your task is to write a program that takes a platform as a lengthed container containing only -
s and s (e.g. a string) and outputs the number of Jimmys that can be placed on the platform such that none of them will fall and none of them will overlap. A Jimmy may have one of their body parts to the left of the beginning of the string or the right of the end of the string.
This is code-golf so answers are scored in bytes with fewer bytes being the aim.
Test cases
Inputs
- - -
- -
--
-- --
----
- -- --
------- -
Respective outputs
0
0
1
1
2
2
2
3
code-golf string
$endgroup$
1
$begingroup$
You should probably make explicit mention that there can be more than one space between two platforms.
$endgroup$
– Shaggy
8 hours ago
$begingroup$
Also, Jimmy's not happy with you...
$endgroup$
– connectyourcharger
3 hours ago
add a comment |
$begingroup$
In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /
, o
, and arranged like this
/o
Platforms are represented with -
. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform.
Some examples:
/o
- -------
Jimmy will balance since all their body parts are above a -
.
/o
------ ---
Jimmy will balanced since two body parts are above -
s.
/o
-- ---- --
Jimmy will balance even though they are split between two platforms
/o
-
Jimmy will not balanced since two body parts are not above a platform.
Your task is to write a program that takes a platform as a lengthed container containing only -
s and s (e.g. a string) and outputs the number of Jimmys that can be placed on the platform such that none of them will fall and none of them will overlap. A Jimmy may have one of their body parts to the left of the beginning of the string or the right of the end of the string.
This is code-golf so answers are scored in bytes with fewer bytes being the aim.
Test cases
Inputs
- - -
- -
--
-- --
----
- -- --
------- -
Respective outputs
0
0
1
1
2
2
2
3
code-golf string
$endgroup$
In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /
, o
, and arranged like this
/o
Platforms are represented with -
. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform.
Some examples:
/o
- -------
Jimmy will balance since all their body parts are above a -
.
/o
------ ---
Jimmy will balanced since two body parts are above -
s.
/o
-- ---- --
Jimmy will balance even though they are split between two platforms
/o
-
Jimmy will not balanced since two body parts are not above a platform.
Your task is to write a program that takes a platform as a lengthed container containing only -
s and s (e.g. a string) and outputs the number of Jimmys that can be placed on the platform such that none of them will fall and none of them will overlap. A Jimmy may have one of their body parts to the left of the beginning of the string or the right of the end of the string.
This is code-golf so answers are scored in bytes with fewer bytes being the aim.
Test cases
Inputs
- - -
- -
--
-- --
----
- -- --
------- -
Respective outputs
0
0
1
1
2
2
2
3
code-golf string
code-golf string
edited 8 hours ago
Sriotchilism O'Zaic
asked 8 hours ago
Sriotchilism O'ZaicSriotchilism O'Zaic
36.2k10 gold badges162 silver badges372 bronze badges
36.2k10 gold badges162 silver badges372 bronze badges
1
$begingroup$
You should probably make explicit mention that there can be more than one space between two platforms.
$endgroup$
– Shaggy
8 hours ago
$begingroup$
Also, Jimmy's not happy with you...
$endgroup$
– connectyourcharger
3 hours ago
add a comment |
1
$begingroup$
You should probably make explicit mention that there can be more than one space between two platforms.
$endgroup$
– Shaggy
8 hours ago
$begingroup$
Also, Jimmy's not happy with you...
$endgroup$
– connectyourcharger
3 hours ago
1
1
$begingroup$
You should probably make explicit mention that there can be more than one space between two platforms.
$endgroup$
– Shaggy
8 hours ago
$begingroup$
You should probably make explicit mention that there can be more than one space between two platforms.
$endgroup$
– Shaggy
8 hours ago
$begingroup$
Also, Jimmy's not happy with you...
$endgroup$
– connectyourcharger
3 hours ago
$begingroup$
Also, Jimmy's not happy with you...
$endgroup$
– connectyourcharger
3 hours ago
add a comment |
6 Answers
6
active
oldest
votes
$begingroup$
JavaScript (ES6), 45 41 40 bytes
Saved 4 bytes thanks to @Shaggy
s=>(0+s+0).split(/.--|-.-|--./).length-1
Try it online!
$endgroup$
$begingroup$
41 bytes
$endgroup$
– Shaggy
7 hours ago
$begingroup$
@Shaggy Thanks! I knew something was wrong there, but I had to help my wife on some Super Mario Galaxy level in the meantime... and it was also a problem about broken platforms. :p
$endgroup$
– Arnauld
7 hours ago
$begingroup$
the---
wasn't sitting well with me either, until I was working on my port and realised they weren't needed. Think I'll call it a day here, grab a bag of cans and throw on SMG myself - haven't played it in an age.
$endgroup$
– Shaggy
6 hours ago
add a comment |
$begingroup$
Python 2, 53 bytes
lambda s:len(re.findall('.--|-.-|--.',`s`))
import re
Try it online!
Based on Arnauld's regex. Greedily searches for all the non-overlapping length-3 substrings with two or more -
. A trick is to do `s`
to enclose the input string in quotes as padding to leave room for Jimmys to hang off on either end like
/o/o
'----'
Python 2, 57 bytes
f=lambda s:'--'in s[:3]*2and-~f(s[3:])or s>''and f(s[1:])
Try it online!
Requires a cheesy I/O format of the input already in quotes. Outputs False
for 0.
A recursive function that places each Jimmy on the leftmost position allowed, by either placing Jimmy over the first three characters if they can hold Jimmy, or otherwise deleting the first character. A cute trick is to check if s[:3]
contains two or more -
by doing '--'in s[:3]*2
, which concatenates two copies of s[:3]
and checks for two adjacent -
.
$endgroup$
add a comment |
$begingroup$
Perl 5 -p
, 28 bytes
Uses the same method as @Arnauld's JavaScript.
$_=@a=" $_ "=~/.--|-.-|--./g
Try it online!
$endgroup$
add a comment |
$begingroup$
Japt, 16 bytes
Based on Arnauld's original JS solution. I tried a few different methods to get the necessary padding either side of the input but all came in at the same length - still searching for a shorter way...
ûUÊÄÄ è".--|-."ê
Test it
ûUÊÄÄ è".--|-."ê :Implicit input of string U
û :Centre pad with spaces to length
UÊ : Length of U
ÄÄ : Add 1, twice
è :Count the occurrences of
".--|-."ê : ".--|-." palindromised, resulting in the RegEx /.--|-.-|--./g
$endgroup$
add a comment |
$begingroup$
Stax, 13 bytes
ƒó±KêyG←à╛Ωô∟
Run and debug it
$endgroup$
add a comment |
$begingroup$
Excel, 96 bytes
A1
= platform.
Entered as array Formula Ctrl
+Shift
+Enter
=SUM(IF(LEN(TRIM(MID(IF(MOD(LEN(A1),3)=1," ","")&A1,3*ROW(INDIRECT("A1:A"&LEN(A1)))-2,3)))>1,1))
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "200"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187682%2fhow-many-jimmys-can-fit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
JavaScript (ES6), 45 41 40 bytes
Saved 4 bytes thanks to @Shaggy
s=>(0+s+0).split(/.--|-.-|--./).length-1
Try it online!
$endgroup$
$begingroup$
41 bytes
$endgroup$
– Shaggy
7 hours ago
$begingroup$
@Shaggy Thanks! I knew something was wrong there, but I had to help my wife on some Super Mario Galaxy level in the meantime... and it was also a problem about broken platforms. :p
$endgroup$
– Arnauld
7 hours ago
$begingroup$
the---
wasn't sitting well with me either, until I was working on my port and realised they weren't needed. Think I'll call it a day here, grab a bag of cans and throw on SMG myself - haven't played it in an age.
$endgroup$
– Shaggy
6 hours ago
add a comment |
$begingroup$
JavaScript (ES6), 45 41 40 bytes
Saved 4 bytes thanks to @Shaggy
s=>(0+s+0).split(/.--|-.-|--./).length-1
Try it online!
$endgroup$
$begingroup$
41 bytes
$endgroup$
– Shaggy
7 hours ago
$begingroup$
@Shaggy Thanks! I knew something was wrong there, but I had to help my wife on some Super Mario Galaxy level in the meantime... and it was also a problem about broken platforms. :p
$endgroup$
– Arnauld
7 hours ago
$begingroup$
the---
wasn't sitting well with me either, until I was working on my port and realised they weren't needed. Think I'll call it a day here, grab a bag of cans and throw on SMG myself - haven't played it in an age.
$endgroup$
– Shaggy
6 hours ago
add a comment |
$begingroup$
JavaScript (ES6), 45 41 40 bytes
Saved 4 bytes thanks to @Shaggy
s=>(0+s+0).split(/.--|-.-|--./).length-1
Try it online!
$endgroup$
JavaScript (ES6), 45 41 40 bytes
Saved 4 bytes thanks to @Shaggy
s=>(0+s+0).split(/.--|-.-|--./).length-1
Try it online!
edited 6 hours ago
answered 8 hours ago
ArnauldArnauld
87.7k7 gold badges102 silver badges358 bronze badges
87.7k7 gold badges102 silver badges358 bronze badges
$begingroup$
41 bytes
$endgroup$
– Shaggy
7 hours ago
$begingroup$
@Shaggy Thanks! I knew something was wrong there, but I had to help my wife on some Super Mario Galaxy level in the meantime... and it was also a problem about broken platforms. :p
$endgroup$
– Arnauld
7 hours ago
$begingroup$
the---
wasn't sitting well with me either, until I was working on my port and realised they weren't needed. Think I'll call it a day here, grab a bag of cans and throw on SMG myself - haven't played it in an age.
$endgroup$
– Shaggy
6 hours ago
add a comment |
$begingroup$
41 bytes
$endgroup$
– Shaggy
7 hours ago
$begingroup$
@Shaggy Thanks! I knew something was wrong there, but I had to help my wife on some Super Mario Galaxy level in the meantime... and it was also a problem about broken platforms. :p
$endgroup$
– Arnauld
7 hours ago
$begingroup$
the---
wasn't sitting well with me either, until I was working on my port and realised they weren't needed. Think I'll call it a day here, grab a bag of cans and throw on SMG myself - haven't played it in an age.
$endgroup$
– Shaggy
6 hours ago
$begingroup$
41 bytes
$endgroup$
– Shaggy
7 hours ago
$begingroup$
41 bytes
$endgroup$
– Shaggy
7 hours ago
$begingroup$
@Shaggy Thanks! I knew something was wrong there, but I had to help my wife on some Super Mario Galaxy level in the meantime... and it was also a problem about broken platforms. :p
$endgroup$
– Arnauld
7 hours ago
$begingroup$
@Shaggy Thanks! I knew something was wrong there, but I had to help my wife on some Super Mario Galaxy level in the meantime... and it was also a problem about broken platforms. :p
$endgroup$
– Arnauld
7 hours ago
$begingroup$
the
---
wasn't sitting well with me either, until I was working on my port and realised they weren't needed. Think I'll call it a day here, grab a bag of cans and throw on SMG myself - haven't played it in an age.$endgroup$
– Shaggy
6 hours ago
$begingroup$
the
---
wasn't sitting well with me either, until I was working on my port and realised they weren't needed. Think I'll call it a day here, grab a bag of cans and throw on SMG myself - haven't played it in an age.$endgroup$
– Shaggy
6 hours ago
add a comment |
$begingroup$
Python 2, 53 bytes
lambda s:len(re.findall('.--|-.-|--.',`s`))
import re
Try it online!
Based on Arnauld's regex. Greedily searches for all the non-overlapping length-3 substrings with two or more -
. A trick is to do `s`
to enclose the input string in quotes as padding to leave room for Jimmys to hang off on either end like
/o/o
'----'
Python 2, 57 bytes
f=lambda s:'--'in s[:3]*2and-~f(s[3:])or s>''and f(s[1:])
Try it online!
Requires a cheesy I/O format of the input already in quotes. Outputs False
for 0.
A recursive function that places each Jimmy on the leftmost position allowed, by either placing Jimmy over the first three characters if they can hold Jimmy, or otherwise deleting the first character. A cute trick is to check if s[:3]
contains two or more -
by doing '--'in s[:3]*2
, which concatenates two copies of s[:3]
and checks for two adjacent -
.
$endgroup$
add a comment |
$begingroup$
Python 2, 53 bytes
lambda s:len(re.findall('.--|-.-|--.',`s`))
import re
Try it online!
Based on Arnauld's regex. Greedily searches for all the non-overlapping length-3 substrings with two or more -
. A trick is to do `s`
to enclose the input string in quotes as padding to leave room for Jimmys to hang off on either end like
/o/o
'----'
Python 2, 57 bytes
f=lambda s:'--'in s[:3]*2and-~f(s[3:])or s>''and f(s[1:])
Try it online!
Requires a cheesy I/O format of the input already in quotes. Outputs False
for 0.
A recursive function that places each Jimmy on the leftmost position allowed, by either placing Jimmy over the first three characters if they can hold Jimmy, or otherwise deleting the first character. A cute trick is to check if s[:3]
contains two or more -
by doing '--'in s[:3]*2
, which concatenates two copies of s[:3]
and checks for two adjacent -
.
$endgroup$
add a comment |
$begingroup$
Python 2, 53 bytes
lambda s:len(re.findall('.--|-.-|--.',`s`))
import re
Try it online!
Based on Arnauld's regex. Greedily searches for all the non-overlapping length-3 substrings with two or more -
. A trick is to do `s`
to enclose the input string in quotes as padding to leave room for Jimmys to hang off on either end like
/o/o
'----'
Python 2, 57 bytes
f=lambda s:'--'in s[:3]*2and-~f(s[3:])or s>''and f(s[1:])
Try it online!
Requires a cheesy I/O format of the input already in quotes. Outputs False
for 0.
A recursive function that places each Jimmy on the leftmost position allowed, by either placing Jimmy over the first three characters if they can hold Jimmy, or otherwise deleting the first character. A cute trick is to check if s[:3]
contains two or more -
by doing '--'in s[:3]*2
, which concatenates two copies of s[:3]
and checks for two adjacent -
.
$endgroup$
Python 2, 53 bytes
lambda s:len(re.findall('.--|-.-|--.',`s`))
import re
Try it online!
Based on Arnauld's regex. Greedily searches for all the non-overlapping length-3 substrings with two or more -
. A trick is to do `s`
to enclose the input string in quotes as padding to leave room for Jimmys to hang off on either end like
/o/o
'----'
Python 2, 57 bytes
f=lambda s:'--'in s[:3]*2and-~f(s[3:])or s>''and f(s[1:])
Try it online!
Requires a cheesy I/O format of the input already in quotes. Outputs False
for 0.
A recursive function that places each Jimmy on the leftmost position allowed, by either placing Jimmy over the first three characters if they can hold Jimmy, or otherwise deleting the first character. A cute trick is to check if s[:3]
contains two or more -
by doing '--'in s[:3]*2
, which concatenates two copies of s[:3]
and checks for two adjacent -
.
edited 7 hours ago
answered 7 hours ago
xnorxnor
96.9k19 gold badges200 silver badges460 bronze badges
96.9k19 gold badges200 silver badges460 bronze badges
add a comment |
add a comment |
$begingroup$
Perl 5 -p
, 28 bytes
Uses the same method as @Arnauld's JavaScript.
$_=@a=" $_ "=~/.--|-.-|--./g
Try it online!
$endgroup$
add a comment |
$begingroup$
Perl 5 -p
, 28 bytes
Uses the same method as @Arnauld's JavaScript.
$_=@a=" $_ "=~/.--|-.-|--./g
Try it online!
$endgroup$
add a comment |
$begingroup$
Perl 5 -p
, 28 bytes
Uses the same method as @Arnauld's JavaScript.
$_=@a=" $_ "=~/.--|-.-|--./g
Try it online!
$endgroup$
Perl 5 -p
, 28 bytes
Uses the same method as @Arnauld's JavaScript.
$_=@a=" $_ "=~/.--|-.-|--./g
Try it online!
answered 6 hours ago
XcaliXcali
6,2175 silver badges23 bronze badges
6,2175 silver badges23 bronze badges
add a comment |
add a comment |
$begingroup$
Japt, 16 bytes
Based on Arnauld's original JS solution. I tried a few different methods to get the necessary padding either side of the input but all came in at the same length - still searching for a shorter way...
ûUÊÄÄ è".--|-."ê
Test it
ûUÊÄÄ è".--|-."ê :Implicit input of string U
û :Centre pad with spaces to length
UÊ : Length of U
ÄÄ : Add 1, twice
è :Count the occurrences of
".--|-."ê : ".--|-." palindromised, resulting in the RegEx /.--|-.-|--./g
$endgroup$
add a comment |
$begingroup$
Japt, 16 bytes
Based on Arnauld's original JS solution. I tried a few different methods to get the necessary padding either side of the input but all came in at the same length - still searching for a shorter way...
ûUÊÄÄ è".--|-."ê
Test it
ûUÊÄÄ è".--|-."ê :Implicit input of string U
û :Centre pad with spaces to length
UÊ : Length of U
ÄÄ : Add 1, twice
è :Count the occurrences of
".--|-."ê : ".--|-." palindromised, resulting in the RegEx /.--|-.-|--./g
$endgroup$
add a comment |
$begingroup$
Japt, 16 bytes
Based on Arnauld's original JS solution. I tried a few different methods to get the necessary padding either side of the input but all came in at the same length - still searching for a shorter way...
ûUÊÄÄ è".--|-."ê
Test it
ûUÊÄÄ è".--|-."ê :Implicit input of string U
û :Centre pad with spaces to length
UÊ : Length of U
ÄÄ : Add 1, twice
è :Count the occurrences of
".--|-."ê : ".--|-." palindromised, resulting in the RegEx /.--|-.-|--./g
$endgroup$
Japt, 16 bytes
Based on Arnauld's original JS solution. I tried a few different methods to get the necessary padding either side of the input but all came in at the same length - still searching for a shorter way...
ûUÊÄÄ è".--|-."ê
Test it
ûUÊÄÄ è".--|-."ê :Implicit input of string U
û :Centre pad with spaces to length
UÊ : Length of U
ÄÄ : Add 1, twice
è :Count the occurrences of
".--|-."ê : ".--|-." palindromised, resulting in the RegEx /.--|-.-|--./g
edited 6 hours ago
answered 7 hours ago
ShaggyShaggy
20.1k3 gold badges20 silver badges68 bronze badges
20.1k3 gold badges20 silver badges68 bronze badges
add a comment |
add a comment |
$begingroup$
Stax, 13 bytes
ƒó±KêyG←à╛Ωô∟
Run and debug it
$endgroup$
add a comment |
$begingroup$
Stax, 13 bytes
ƒó±KêyG←à╛Ωô∟
Run and debug it
$endgroup$
add a comment |
$begingroup$
Stax, 13 bytes
ƒó±KêyG←à╛Ωô∟
Run and debug it
$endgroup$
Stax, 13 bytes
ƒó±KêyG←à╛Ωô∟
Run and debug it
answered 5 hours ago
recursiverecursive
6,87914 silver badges27 bronze badges
6,87914 silver badges27 bronze badges
add a comment |
add a comment |
$begingroup$
Excel, 96 bytes
A1
= platform.
Entered as array Formula Ctrl
+Shift
+Enter
=SUM(IF(LEN(TRIM(MID(IF(MOD(LEN(A1),3)=1," ","")&A1,3*ROW(INDIRECT("A1:A"&LEN(A1)))-2,3)))>1,1))
$endgroup$
add a comment |
$begingroup$
Excel, 96 bytes
A1
= platform.
Entered as array Formula Ctrl
+Shift
+Enter
=SUM(IF(LEN(TRIM(MID(IF(MOD(LEN(A1),3)=1," ","")&A1,3*ROW(INDIRECT("A1:A"&LEN(A1)))-2,3)))>1,1))
$endgroup$
add a comment |
$begingroup$
Excel, 96 bytes
A1
= platform.
Entered as array Formula Ctrl
+Shift
+Enter
=SUM(IF(LEN(TRIM(MID(IF(MOD(LEN(A1),3)=1," ","")&A1,3*ROW(INDIRECT("A1:A"&LEN(A1)))-2,3)))>1,1))
$endgroup$
Excel, 96 bytes
A1
= platform.
Entered as array Formula Ctrl
+Shift
+Enter
=SUM(IF(LEN(TRIM(MID(IF(MOD(LEN(A1),3)=1," ","")&A1,3*ROW(INDIRECT("A1:A"&LEN(A1)))-2,3)))>1,1))
answered 1 hour ago
remoelremoel
4812 silver badges6 bronze badges
4812 silver badges6 bronze badges
add a comment |
add a comment |
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f187682%2fhow-many-jimmys-can-fit%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
$begingroup$
You should probably make explicit mention that there can be more than one space between two platforms.
$endgroup$
– Shaggy
8 hours ago
$begingroup$
Also, Jimmy's not happy with you...
$endgroup$
– connectyourcharger
3 hours ago