Skip to main content
Commonmark migration
Source Link

Japt, 24 bytes

£Xn >J?U=UhYUgJ+Y-X):PÃU

Try it online!

###Explanation:

Explanation:

£Xn >J?U=UhYUgJ+Y-X):PÃU
£                     Ã    Iterate through the input (implicit U) 
                             X becomes the iterative item, Y becomes the index
 Xn                          Try parseInt(X)
    >J                       > -1
                               In this case, this checks if X is a digit
      ?                      If true:
       U=                      Set U to 
         UhY                     U with the char at index Y set to:     
            UgJ+Y-X               The index at -1+Y-X
                   ):        Else:
                     P         variable P (just a no-op in this case)
                       U   Finally, return U
        

Japt, 24 bytes

£Xn >J?U=UhYUgJ+Y-X):PÃU

Try it online!

###Explanation:

£Xn >J?U=UhYUgJ+Y-X):PÃU
£                     Ã    Iterate through the input (implicit U) 
                             X becomes the iterative item, Y becomes the index
 Xn                          Try parseInt(X)
    >J                       > -1
                               In this case, this checks if X is a digit
      ?                      If true:
       U=                      Set U to 
         UhY                     U with the char at index Y set to:     
            UgJ+Y-X               The index at -1+Y-X
                   ):        Else:
                     P         variable P (just a no-op in this case)
                       U   Finally, return U
        

Japt, 24 bytes

£Xn >J?U=UhYUgJ+Y-X):PÃU

Try it online!

Explanation:

£Xn >J?U=UhYUgJ+Y-X):PÃU
£                     Ã    Iterate through the input (implicit U) 
                             X becomes the iterative item, Y becomes the index
 Xn                          Try parseInt(X)
    >J                       > -1
                               In this case, this checks if X is a digit
      ?                      If true:
       U=                      Set U to 
         UhY                     U with the char at index Y set to:     
            UgJ+Y-X               The index at -1+Y-X
                   ):        Else:
                     P         variable P (just a no-op in this case)
                       U   Finally, return U
        
added 25 characters in body
Source Link
ETHproductions
  • 50.4k
  • 6
  • 96
  • 242

Japt, 24 bytes

£Xn >J?U=UhYUgJ+Y-X):PÃU

Try it online!

###Explanation: £Xn >J?U=UhYUgJ+Y-X):PÃU £ Iterate through the input (implicit U) X becomes the iterative item, Y becomes the index Xn Try X.parseInt() >J > -1 We are checking if X is an integer greater than -1 ? If true: U= Update U to: UhY Set the char at index Y to:
UgJ+Y-X The index at -1+Y-X ): Else: P Push "" ÃU Finally, return U

£Xn >J?U=UhYUgJ+Y-X):PÃU
£                     Ã    Iterate through the input (implicit U) 
                             X becomes the iterative item, Y becomes the index
 Xn                          Try parseInt(X)
    >J                       > -1
                               In this case, this checks if X is a digit
      ?                      If true:
       U=                      Set U to 
         UhY                     U with the char at index Y set to:     
            UgJ+Y-X               The index at -1+Y-X
                   ):        Else:
                     P         variable P (just a no-op in this case)
                       U   Finally, return U
        

Japt, 24 bytes

£Xn >J?U=UhYUgJ+Y-X):PÃU

Try it online!

###Explanation: £Xn >J?U=UhYUgJ+Y-X):PÃU £ Iterate through the input (implicit U) X becomes the iterative item, Y becomes the index Xn Try X.parseInt() >J > -1 We are checking if X is an integer greater than -1 ? If true: U= Update U to: UhY Set the char at index Y to:
UgJ+Y-X The index at -1+Y-X ): Else: P Push "" ÃU Finally, return U

Japt, 24 bytes

£Xn >J?U=UhYUgJ+Y-X):PÃU

Try it online!

###Explanation:

£Xn >J?U=UhYUgJ+Y-X):PÃU
£                     Ã    Iterate through the input (implicit U) 
                             X becomes the iterative item, Y becomes the index
 Xn                          Try parseInt(X)
    >J                       > -1
                               In this case, this checks if X is a digit
      ?                      If true:
       U=                      Set U to 
         UhY                     U with the char at index Y set to:     
            UgJ+Y-X               The index at -1+Y-X
                   ):        Else:
                     P         variable P (just a no-op in this case)
                       U   Finally, return U
        
deleted 16 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38

Japt, 2524 bytes

£Xn >J?U=UhYUgJ+Y-Xn¹X):PÃU

Try it online!Try it online!

###Explanation: £Xn >J?U=UhYUgJ+Y-X):PÃU £ Iterate through the input (implicit U) X becomes the iterative item, Y becomes the index Xn Try X.parseInt() >J > -1 We are checking if X is an integer greater than -1 ? If true: U= Update U to: UhY Set the char at index Y to:
UgJ+Y-X The index at -1+Y-X ): Else: P Push "" ÃU Finally, return U

Japt, 25 bytes

£Xn >J?U=UhYUgJ+Y-Xn¹:PÃU

Try it online!

Japt, 24 bytes

£Xn >J?U=UhYUgJ+Y-X):PÃU

Try it online!

###Explanation: £Xn >J?U=UhYUgJ+Y-X):PÃU £ Iterate through the input (implicit U) X becomes the iterative item, Y becomes the index Xn Try X.parseInt() >J > -1 We are checking if X is an integer greater than -1 ? If true: U= Update U to: UhY Set the char at index Y to:
UgJ+Y-X The index at -1+Y-X ): Else: P Push "" ÃU Finally, return U

deleted 16 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading
deleted 13 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading
deleted 82 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading
added 3 characters in body
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading
Source Link
Oliver
  • 7.9k
  • 2
  • 19
  • 38
Loading