Skip to main content
deleted 2 characters in body
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23

PowerShell, 107 98 82 77 bytes

$l=@{} $args|%{if($_-10){$l.$_+=$x++,+$y}else{$x=0;++$y}} $l|% v*|? c*t -eq 2 

Try it online!

Takes a splatted string with LFs. Returns zero-indexed location x,y. Unrolled:

$l=@$locations=@{} # make a hashtable. key=char, value=array ofvalue=location locationsarray $args|%{ if($_-10){  # if current char is not LF $l$locations.$_+=$x++,+$y # moveadd location$x,$y to nexthashtable posvalue and addmove location$x to hashtablenext valuepos }else{    # else $x=0;++$y $x=0;++$y # move location$x,$y to next line } } $l|%$locations|% Values|? Count -eq 2 # find and output location array with 2 elements (x and ,y) 

PowerShell, 107 98 82 77 bytes

$l=@{} $args|%{if($_-10){$l.$_+=$x++,+$y}else{$x=0;++$y}} $l|% v*|? c*t -eq 2 

Try it online!

Takes a splatted string with LFs. Returns zero-indexed location x,y. Unrolled:

$l=@{} # make a hashtable. key=char, value=array of locations $args|%{ if($_-10){ # if current char is not LF $l.$_+=$x++,+$y # move location to next pos and add location to hashtable value }else{  # else  $x=0;++$y # move location to next line } } $l|% Values|? Count -eq 2 # find and output location array with 2 elements (x and y) 

PowerShell, 107 98 82 77 bytes

$l=@{} $args|%{if($_-10){$l.$_+=$x++,+$y}else{$x=0;++$y}} $l|% v*|? c*t -eq 2 

Try it online!

Takes a splatted string with LFs. Returns zero-indexed location x,y. Unrolled:

$locations=@{} # make a hashtable. key=char, value=location array $args|%{ if($_-10){  # if current char is not LF $locations.$_+=$x++,+$y # add $x,$y to hashtable value and move $x to next pos }else{   $x=0;++$y # move $x,$y to next line } } $locations|% Values|? Count -eq 2 # find and output location array with 2 elements (x,y) 
edited body; deleted 6 characters in body; edited body
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23

PowerShell, 107 98 8282 77 bytes

$l=@{} $args|%{if($_-10){$l.$_+=++$x$_+=$x++,($y+1)+$y}else{$x=0;++$y}} $l.Values|$l|% v*|? C*tc*t -eq 2 

Try it online!Try it online!

Takes a splatted string with LFs. Returns onezero-indexed location x,y. Unrolled:

$l=@{} # make a hashtable. key=char, value=array of locations $args|%{ if($_-10){ # if current char is not LF $l.$_+=++$x$_+=$x++,($y+1)+$y  # move location to next pos and add location to hashtable value }else{ # else $x=0;++$y # move location to next line } } $l.$l|% Values|? Count -eq 2  # find and output location array with 2 elements (x and y) 

PowerShell, 107 98 82 bytes

$l=@{} $args|%{if($_-10){$l.$_+=++$x,($y+1)}else{$x=0;++$y}} $l.Values|? C*t -eq 2 

Try it online!

Takes a splatted string with LFs. Returns one-indexed location x,y. Unrolled:

$l=@{} # make a hashtable. key=char, value=array of locations $args|%{ if($_-10){ # if current char is not LF $l.$_+=++$x,($y+1) # move location to next pos and add location to hashtable value }else{ # else $x=0;++$y # move location to next line } } $l.Values|? Count -eq 2  # find and output location array with 2 elements (x and y) 

PowerShell, 107 98 82 77 bytes

$l=@{} $args|%{if($_-10){$l.$_+=$x++,+$y}else{$x=0;++$y}} $l|% v*|? c*t -eq 2 

Try it online!

Takes a splatted string with LFs. Returns zero-indexed location x,y. Unrolled:

$l=@{} # make a hashtable. key=char, value=array of locations $args|%{ if($_-10){ # if current char is not LF $l.$_+=$x++,+$y  # move location to next pos and add location to hashtable value }else{ # else $x=0;++$y # move location to next line } } $l|% Values|? Count -eq 2 # find and output location array with 2 elements (x and y) 
added 439 characters in body; added 4 characters in body; added 24 characters in body
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23

PowerShell, 107 9898 82 bytes

$z=-join$args-match'(.)\1' $h=$Matches[1]$l=@{} switch -r$args|%{if($args$_-10){$l.{++$x$_+=++$x,($y+1)}\nelse{$x=0;++$y}"[^$h\n]"{$x;$y+1}} $l.Values|? C*t -eq 2 

Try it online!Try it online!

Takes a splatted string with LFs. Returns one-indexed location x,y. Unrolled:

$l=@{} # make a hashtable. key=char, value=array of locations $args|%{ if($_-10){ # if current char is not LF $l.$_+=++$x,($y+1) # move location to next pos and add location to hashtable value }else{ # else $x=0;++$y # move location to next line } } $l.Values|? Count -eq 2 # find and output location array with 2 elements (x and y) 

PowerShell, 107 98 bytes

$z=-join$args-match'(.)\1' $h=$Matches[1] switch -r($args){.{++$x}\n{$x=0;++$y}"[^$h\n]"{$x;$y+1}} 

Try it online!

Takes a splatted string with LFs. Returns one-indexed location x,y.

PowerShell, 107 98 82 bytes

$l=@{} $args|%{if($_-10){$l.$_+=++$x,($y+1)}else{$x=0;++$y}} $l.Values|? C*t -eq 2 

Try it online!

Takes a splatted string with LFs. Returns one-indexed location x,y. Unrolled:

$l=@{} # make a hashtable. key=char, value=array of locations $args|%{ if($_-10){ # if current char is not LF $l.$_+=++$x,($y+1) # move location to next pos and add location to hashtable value }else{ # else $x=0;++$y # move location to next line } } $l.Values|? Count -eq 2 # find and output location array with 2 elements (x and y) 
added 14 characters in body
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23
Loading
added 1 character in body
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23
Loading
Source Link
mazzy
  • 7.2k
  • 2
  • 13
  • 23
Loading