ऐरे रन मिल


14

किसी सरणी के अंदर रन ढूंढें

एक रन को तीन या अधिक संख्याओं के रूप में परिभाषित किया जाता है जो एक स्थिर कदम के साथ पिछले से वृद्धि करते हैं। उदाहरण के लिए [1,2,3] चरण 1 के साथ एक रन होगा, [1,3,5,7] चरण 2 के साथ एक रन होगा, और [1,2,4,5] एक रन नहीं है।

हम इन रन को संकेतन "i to j by s" द्वारा व्यक्त कर सकते हैं, जहाँ मैं रन की पहली संख्या है, j रन की अंतिम संख्या है, और s स्टेप है। हालांकि, चरण 1 के रन "i to j" व्यक्त किए जाएंगे।

तो पहले सरणियों का उपयोग करते हुए, हमें मिलता है:

  • [1,2,3] -> "1to3"

  • [1,3,5,7] -> "1to7by2"

  • [1,2,4,5] -> "1 2 4 5"

इस चुनौती में, एरर्स के लिए ऐसा करना आपका काम है जिसमें कई रन हो सकते हैं।

उदाहरण पुनरावृत्ति के साथ पायथन कोड:

def arr_comp_rec(a, start_index):
    # Early exit and recursion end point
    if start_index == len(a)-1:
        return str(a[-1])
    elif start_index == len(a):
        return ''

    # Keep track of first delta to compare while searching
    first_delta = a[start_index+1] - a[start_index]
    last = True
    for i in range(start_index, len(a)-1):
        delta = a[i+1] - a[i]
        if delta != first_delta:
            last = False
            break
    # If it ran through the for loop, we need to make sure it gets the last value
    if last: i += 1

    if i - start_index > 1:
        # There is more than 2 numbers between the indexes
        if first_delta == 1:
            # We don't need by if step = 1
            return "{}to{} ".format(a[start_index], a[i]) + arr_comp_rec(a, i+1)
        else:
            return "{}to{}by{} ".format(a[start_index], a[i], first_delta) + arr_comp_rec(a, i+1)
    else:
        # There is only one number we can return
        return "{} ".format(a[start_index]) + arr_comp_rec(a, i)

IO लचीला है

इनपुट

सॉर्ट किए गए पॉजिटिव इन्टर्स का एरियर (कोई डुप्लिकेट नहीं)

उत्पादन

एक स्थान, या रन के एक स्ट्रिंग सरणी द्वारा अलग किए गए रनों का स्ट्रिंग

किसी विशेष दिशा में लालची होने की आवश्यकता नहीं है

व्हाट्सएप को पीछे छोड़ सकता है

परीक्षण के मामलों

In: [1000, 1002, 1004, 1006, 1008, 1010]
Out: "1000to1010by2"

In: [1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]
Out: "1to3 5 8 13 21 34 55 89 144 233"

In: [10, 20, 30, 40, 60]
Out: "10to40by10 60"

In: [5, 6, 8, 11, 15, 16, 17]
Out: "5 6 8 11 15to17"

In: [1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 15, 30, 45, 50, 60, 70, 80, 90, 91, 93]
Out: "1to7 9to15by2 30 45 50to90by10 91 93"

यह इसलिए कम से कम बाइट्स जीतता है।



2
क्या यह लालची-से-दाएँ होना चाहिए? (यानी [4, 5, 6, 7, 9, 11, 13, 15]नहीं हो सकता 4to6 7to15by2?)
जोनाथन एलन

1
@JonathanAllan नहीं, यह जरूरी नहीं कि लालची को छोड़ दिया जाए।
WretchedLout

मुझे लगता है कि कोई डुप्लिकेट प्रविष्टियाँ नहीं होंगी?
शायरु असकोतो

1
केवल पॉजिटिव इंटेगर। @ Οurous ट्रेलिंग व्हाट्सएप स्वीकार्य।
WretchedLout

जवाबों:


5

जेली ,  42  40 बाइट्स

-2 केविन क्रूजसेन के लिए धन्यवाद ( ḟ2शून्य से फ़िल्टर करें , बजाय शून्य से शून्य को बदलने के 2,0y)

ŒṖIE×LƲ€ḟ2SƊÞṪµ.ịU,Iḟ1ƊQ€Fż“to“by”ṁṖƊ$)K

एक पूर्ण कार्यक्रम परिणाम को प्रिंट करता है।
(एक मोनडिक लिंक के रूप में एक सूची जिसमें पूर्णांकों और वर्णों के मिश्रण को शामिल किया जाएगा)

इसे ऑनलाइन आज़माएं!
(60 के दशक के भीतर सबसे बड़े परीक्षण-मामले को पूरा करने में अक्षम, इसलिए मैंने हटा दिया[1,2,3,4]।)

कैसे?

ŒṖIE×LƲ€ḟ2SƊÞṪµ.ịU,Iḟ1ƊQ€Fż“to“by”ṁṖƊ$)K - Main Link: list of numbers
ŒṖ                                       - all partitions
           ƊÞ                            - sort by last three links as a monad:
      Ʋ€                                 -   last four links as a monad for €ach:
  I                                      -     incremental differences (of the part)
   E                                     -     all equal?
     L                                   -     length (of the part)
    ×                                    -     multiply
        ḟ2                               -   filter discard twos
          S                              -   sum
             Ṫ                           - tail (gets us the desired partition of the input)
              µ                       )  - perform this monadic chain for €ach:
               .                         -   literal 0.5
                ị                        -   index into (the part) - getting [tail,head]
                 U                       -   upend - getting [head,tail]
                      Ɗ                  -   last three links as a monad:
                   I                     -     incremental differences (of the part)
                     1                   -     literal one
                    ḟ                    -     filter discard (remove the ones)
                  ,                      -   pair -> [[head,tail],[deltasWithoutOnes]]
                       Q€                -   de-duplicate €ach -> [[head,tail],[delta]] or [[head,tail],[]] or [[loneValue],[]]
                         F               -   flatten -> [head,tail,delta] or [head,tail] or [loneValue]
                                     $   -   last two links as a monad:
                                    Ɗ    -     last three links as a monad:
                           “to“by”       -       literal list [['t', 'o'], ['b', 'y']]
                                   Ṗ     -       pop (get flattened result without rightmost entry)
                                  ṁ      -       mould ["to","by"] like that (i.e. ["to","by"] or ["to"] or [])
                         ż               -     zip together      
                                       K - join with spaces
                                         - implicit print

'by' का प्रयोग स्टेप = 1
WretchedLout

ओह गाउड: पी हेड-अप के लिए धन्यवाद!
जोनाथन एलन

2,0ySƲÞḟ2SƊÞ-2 बाइट्स के लिए गोल्फ हो सकता है ।
केविन क्रूज़सेन

@KevinCruijssen बहुत सच्चा, अच्छा गोल्फ, धन्यवाद
जोनाथन एलन

1
@KevinCruijssen FYI करें मुझे याद है कि अब वहाँ क्यों था - मूल रूप से मैं Pएक राशि के बजाय एक उत्पाद के साथ अपनी छंटनी करने की कोशिश कर रहा था , Sऔर शून्य की आवश्यकता होगी।
जोनाथन एलन

6

स्विफ्ट, 246 बाइट्स

func f(_ a:[Int]){
var c=a.count,m=a+a,z=0,r:String=""
for i in 1..<c{m[i]-=a[i-1];if m[i]==m[i-1]{m[i-1]=0}};m[0]=1
for i in 0..<c{if m[i]==0 {z=1}else if z==0{r+=" \(a[i])"}else{r+="to\(a[i])"+(m[i]>1 ? "by\(m[i])":"");z=0;m[i+1]=1}}
print(r)
}

इसे ऑनलाइन आज़माएं!


4
प्रोग्रामिंग पहेलियाँ और कोड गोल्फ में आपका स्वागत है! बहुत अच्छा पहला जवाब। मुझे उम्मीद है कि आप यहाँ रहेंगे क्योंकि स्विफ्ट समुदाय यहाँ है ... वास्तव में छोटा है!
श्री एक्सकोडर



3

जावास्क्रिप्ट (ईएस 6), 129 बाइट्स

स्ट्रिंग्स की एक सरणी देता है।

a=>(a.map((n,i)=>n+[n-a[i+1]||''])+'').replace(/(\d+)(-\d+)(?:,\d+\2)+,(\d+)/g,(_,a,b,c)=>a+'to'+(~b?c+'by'+-b:c)).split(/-\d+,/)

इसे ऑनलाइन आज़माएं!

कैसे?

चरण 1

हम पहले प्रत्येक नंबर पर एक प्रत्यय लगाते हैं, जिसमें '-'अगले नंबर के साथ अंतर होता है, अंतिम प्रविष्टि को छोड़कर जो अपरिवर्तित रहता है। यह नया सरणी एक स्ट्रिंग के लिए coerced है।

(a.map((n, i) => n + [n - a[i + 1] || '']) + '')

उदाहरण:

Input : [ 1, 2, 3, 5, 9, 11, 13, 20 ]
Output: "1-1,2-1,3-2,5-4,9-2,11-2,13-7,20"

चरण 2

हम परिणामस्वरूप स्ट्रिंग में सभी रन की पहचान करते हैं और उन्हें उपयुक्त अंकन के साथ बदलते हैं।

.replace(
  /(\d+)(-\d+)(?:,\d+\2)+,(\d+)/g,
  (_, a, b, c) => a + 'to' + (~b ? c + 'by' + -b : c)
)

उदाहरण:

Input : "1-1,2-1,3-2,5-4,9-2,11-2,13-7,20"
Output: "1to3-2,5-4,9to13by2-7,20"

चरण 3

अंत में, हम अनुगामी अल्पविराम सहित शेष प्रत्ययों पर स्ट्रिंग को विभाजित करते हैं।

.split(/-\d+,/)

उदाहरण:

Input : "1to3-2,5-4,9to13by2-7,20"
Output: [ '1to3', '5', '9to13by2', '20' ]

2

रूबी , 125 118 बाइट्स

->a{i=y=0;a.chunk{|x|-y+y=x}.map{|z,w|2-i<(s=w.size)?"#{w[i*s]}to#{w[~i=0]}"+"by#{z}"*(z<=>1)+' ':' '*i+w*' '*i=1}*''}

इसे ऑनलाइन आज़माएं!

व्याख्या

रूबी की एन्यूमरेबल में एक उपयोगी chunkविधि है जो ठीक वही करती है जो हमें यहाँ चाहिए - यह ब्लॉक से समान रिटर्न वैल्यू के लगातार रन द्वारा आइटमों को हमारे मामले में - वर्तमान ( x) और पिछले ( y) मान के बीच का अंतर करती है ।

चेतावनी यह है कि इस तरह की रणनीति रन के पहले तत्व पर कब्जा नहीं करेगी, जैसे कि यहां केवल दो अंतिम तत्वों को एक साथ रखा गया है:

Input: [5, 6, 8, 11, 15, 16, 17]
Grouped: [[5, [5]], [1, [6]], [2, [8]], [3, [11]], [4, [15]], [1, [16, 17]]]

इसलिए, सही ढंग से स्वरूपित स्ट्रिंग्स की मैपिंग करते समय, जब हम एक नए संभावित रन (> 1 आइटम के साथ चंक) का सामना करते हैं, तो हमें यह ट्रैक करना होगा कि क्या पिछला आइटम सिंगल था ( i=1) या पहले से ही किसी अन्य रन ( i=0) में उपयोग किया गया था । यदि कोई अप्रयुक्त एकल आइटम है, तो यह रन का शुरुआती बिंदु बन जाता है और 3 से 2 तक चंक साइज की सीमा को कम करता है।


2

आर , 180 175 बाइट्स

r=rle(c(0,diff(a<-scan())));for(j in 1:sum(1|r$l)){l=r$l[j];v=r$v[j];i=T+l-1;cat("if"(l>2-F,paste0(a[T][!F],"to",a[i],"by"[v>1],v[v>1]," "),c("",a[T:i])[-3^F]));T=i+1;F=l<3-F}

इसे ऑनलाइन आज़माएं!

वैचारिक रूप से, यह मेरे रूबी जवाब का एक बंदरगाह है , हालांकि स्पष्ट रूप से तकनीकी रूप से काफी अलग है।

JayCe द्वारा 5 बाइट्स बचाए गए।


मैं कुछ के साथ चाहता rleथा, लेकिन बहुत आलसी था ... आप 1 बाइट कर सकते sum(1|x)हैं length(x): TIO
JayCe

वास्तव में आपके पास cat 175 बाइट्स के लिए सिर्फ 1 हो सकता है : TIO
JayCe

आह, महान, धन्यवाद!
किरिल एल।

2

आर , 238 217 बाइट्स

धन्यवाद @digEmAll -19 बाइट्स के लिए।

function(v,R=rle(diff(v)),L=R$l,S=sum(L|1),Y=0)if(!S)cat(v)else for(i in 1:S){D=R$v[i]
N=L[i]-F
if(N>1){N=N+1
cat(v[Y+1],'to',v[Y+N],'by'[D>1],D[D>1],' ',sep='')
F=1}else{N=N+(i==S)
if(N>0)cat(v[Y+1:N],'')
F=0}
Y=Y+N}

इसे ऑनलाइन आज़माएं!


Fइसके बजाय इसका उपयोग nपहले से ही आरंभिक है 0, जो कुछ बाइट्स को सहेजना चाहिए, मुझे लगता है।
ग्यूसेप

यह एक निराशा है। आप बस का उपयोग करके लगभग वहाँ हैं split, diffऔर rle। दुर्भाग्य से, रनों की लालची खोज का मतलब बहुत अधिक फ़िज़ूल है।
जे। डो।

214 बाइट्स लगभग वहाँ, एकमात्र समस्या कभी-कभी
अनपेक्षित

यह 'by'[D>1]एक अच्छी चाल है।
जे। डो।

यह ठीक काम करने के लिए लगता है 217 बाइट्स
digEmAll




1

पायथन 2 , 170 166 बाइट्स

def f(a):
 j=len(a)
 while j>2:
	l,r=a[:j:j-1];s=(r-l)/~-j
	if a[:j]==range(l,r+1,s):return[`l`+'to%d'%r+'by%d'%s*(s>1)]+f(a[j:])
	j-=1
 return a and[`a[0]`]+f(a[1:])

इसे ऑनलाइन आज़माएं!


मुझे यकीन नहीं है कि यह आउटपुट प्रारूप वैध है; रन सभी तार होना चाहिए, नहीं?
11

@EriktheOutgolfer फिक्स्ड
टीएफडीएल


1

gvm (कमिट 2612106 ) बाईटेकोड , 108 बाइट्स

एक पंक्ति में सरणी के आकार की अपेक्षा करता है, फिर सदस्य प्रत्येक एक पंक्ति में।

Hexdump:

> hexdump -C findruns.bin
00000000  e1 0a 00 10 00 e1 0b 00  ff c8 92 00 f4 f7 10 00  |................|
00000010  01 b0 20 03 00 ff 0a 01  a2 01 c8 92 00 f4 01 c0  |.. .............|
00000020  03 00 ff 0a 02 d0 72 01  0a 03 c8 92 00 f4 05 b0  |......r.........|
00000030  20 a2 02 c0 02 02 6a 03  8b 00 ff f6 06 b0 20 a2  | .....j....... .|
00000040  02 f4 ce 0a 02 c8 92 00  f6 07 6a 03 8b 00 ff f6  |..........j.....|
00000050  f2 b9 66 01 a2 02 00 01  8a 03 f6 05 b9 69 01 a2  |..f..........i..|
00000060  03 92 00 f4 ac c0 74 6f  00 62 79 00              |......to.by.|
0000006c

टेस्ट रन:

> echo -e "7\n5\n6\n8\n11\n15\n16\n17\n" | ./gvm findruns.bin
5 6 8 11 15to17
> echo -e "20\n1\n2\n3\n4\n5\n6\n7\n9\n11\n13\n15\n30\n45\n50\n60\n70\n80\n90\n91\n93\n" | ./gvm findruns.bin
1to7 9to15by2 30 45 50to90by10 91 93

मैन्युअल रूप से इस से इकट्ठा:

0100  e1        rud                     ; read length of array
0101  0a 00     sta     $00             ; -> to $00
0103  10 00     ldx     #$00            ; loop counter
                  readloop:
0105  e1        rud                     ; read unsigned number
0106  0b 00 ff  sta     $ff00,x         ; store in array at ff00
0109  c8        inx                     ; next index
010a  92 00     cpx     $00             ; length reached?
010c  f4 f7     bne     readloop        ; no -> read next number
010e  10 00     ldx     #$00            ; loop counter
0110  01                                ; 'lda $20b0', to skip next instruction
                  runloop:
0111  b0 20     wch     #' '            ; write space character
0113  03 00 ff  lda     $ff00,x         ; load next number from array
0116  0a 01     sta     $01             ; -> to $01
0118  a2 01     wud     $01             ; and output
011a  c8        inx                     ; next index
011b  92 00     cpx     $00             ; length reached?
011d  f4 01     bne     compare         ; if not calculate difference
011f  c0        hlt                     ; done
                  compare:
0120  03 00 ff  lda     $ff00,x         ; load next number from array
0123  0a 02     sta     $02             ; -> to $01
0125  d0        sec                     ; calculate ...
0126  72 01     sbc     $01             ; ... difference ...
0128  0a 03     sta     $03             ; ... to $03
012a  c8        inx                     ; next index
012b  92 00     cpx     $00             ; length reached?
012d  f4 05     bne     checkrun        ; if not check whether we have a run
012f  b0 20     wch     #' '            ; output space
0131  a2 02     wud     $02             ; output number
0133  c0        hlt                     ; done
                  checkrun:
0134  02 02     lda     $02             ; calculate next ...
0136  6a 03     adc     $03             ; ... expected number in run
0138  8b 00 ff  cmp     $ff00,x         ; compare with real next number
013b  f6 06     beq     haverun         ; ok -> found a run
013d  b0 20     wch     #' '            ; otherwise output space ...
013f  a2 02     wud     $02             ; ... and number
0141  f4 ce     bne     runloop         ; and repeat searching for runs
                  haverun:
0143  0a 02     sta     $02             ; store number to $02
0145  c8        inx                     ; next index
0146  92 00     cpx     $00             ; length reached?
0148  f6 07     beq     outputrun       ; yes -> output this run
014a  6a 03     adc     $03             ; calculate next expected number
014c  8b 00 ff  cmp     $ff00,x         ; compare with real next number
014f  f6 f2     beq     haverun         ; ok -> continue parsing run
                  outputrun:
0151  b9 66 01  wtx     str_to          ; write "to"
0154  a2 02     wud     $02             ; write end number of run
0156  00 01     lda     #$01            ; compare #1 with ...
0158  8a 03     cmp     $03             ; ... step size
015a  f6 05     beq     skip_by         ; equal, then skip output of "by"
015c  b9 69 01  wtx     str_by          ; output "by"
015f  a2 03     wud     $03             ; output step size
                  skip_by:
0161  92 00     cpx     $00             ; length of array reached?
0163  f4 ac     bne     runloop         ; no -> repeat searching for runs
0165  c0        hlt                     ; done
                  str_to:
0166  74 6f 00                          ; "to"
                  str_by:
0169  62 79 00                          ; "by"
016c

1

05AB1E (विरासत) , 49 50 बाइट्स

.œʒε¥Ë}P}Σ€g2KO>}¤εD©g≠i¬s¤„toý¬®¥0èDU≠i„byX««]˜ðý

रास्ता बहुत लंबा है, लेकिन मुझे खुशी है कि यह काम कर रहा है। यह चुनौती बहुत कठिन है, क्योंकि यह इमो दिखता है। @JonathanAllan के जेली उत्तर (धन्यवाद!) से
Σ€g2KO>}¤ एक पोर्ट है ।2,0ySƲÞṪ

इसे ऑनलाइन आज़माएं। (नोट: बड़े परीक्षण मामलों के लिए समय निकालें।)

+1 बाइट बग-फिक्स के रूप में क्योंकि 0हमेशा सॉर्टिंग करते समय अनुगामी स्थिति में रखा जाता है।

स्पष्टीकरण:

                       # Get all partions of the (implicit) input-list
                         #  i.e. [1,2,3,11,18,20,22,24,32,33,34]
                         #   → [[[1],[2],[3],[11],[18],[20],[22],[24],[32],[33],[34]],
                         #      [[1],[2],[3],[11],[18],[20],[22],[24],[32],[33,34]],
                         #      [[1],[2],[3],[11],[18],[20],[22],[24],[32,33],[34]],
                         #      ...]
  ʒ     }                # Filter this list by:
   ε  }                  #  Map the current sub-list by:
    ¥Ë                   #   Take the deltas, and check if all are equal
                         #    i.e. [1,2,3] → [1,1] → 1
                         #    i.e. [1,2,3,11] → [1,1,8] → 0
       P                 #  Check if all sub-list have equal deltas
  Σ      }               # Now that we've filtered the list, sort it by:
   g                    #  Take the length of each sub-list
                         #   i.e. [[1,2,3],[11,18],[20,22,24],[32,33],[34]]
                         #    → [3,2,3,2,1]
                         #   i.e. [[1,2,3],[11],[18,20,22,24],[32,33,34]]
                         #    → [3,1,4,3]
     2K                  #  Remove all 2s
                         #   i.e. [3,2,3,2,1] → ['3','3','1']
       O                 #  And take the sum
                         #   i.e. ['3','3','1'] → 7
                         #   i.e. [3,1,4,3] → 11
        >                #  And increase the sum by 1 (0 is always trailing when sorting)
          ¤              # And then take the last item of this sorted list
                         #  i.e. for input [1,2,3,11,18,20,22,24,32,33,34]
                         #   → [[1,2,3],[11],[18,20,22,24],[32,33,34]]
  ε                      # Now map each of the sub-lists to:
   D©                    #  Save the current sub-list in the register
     gi                 #  If its length is not 1:
                         #    i.e. [11] → 1 → 0 (falsey)
                         #    i.e. [18,20,22,24] → 4 → 1 (truthy)
        ¬s¤              #   Take the head and tail of the sub-list
                         #    i.e. [18,20,22,24] → 18 and 24
           toý          #   And join them with "to"
                         #    i.e. 18 and 24 → ['18to24', '18to20to22to24']
               ¬         #   (head to remove some access waste we no longer need)
                         #    i.e. ['18to24', '18to20to22to24'] → '18to24'
        ®                #   Get the sub-list from the register again
         ¥               #   Take its deltas
                         #    i.e. [18,20,22,24] → [2,2,2]
          0è             #   Get the first item (should all be the same delta)
                         #    i.e. [2,2,2] → 2
            DU           #   Save it in variable `X`
              i         #   If the delta is not 1:
                         #     i.e. 2 → 1 (truthy)
                byX«    #    Merge "by" with `X`
                         #     i.e. 2 → 'by2'
                     «   #    And merge it with the earlier "#to#"
                         #     i.e. '18to24' and 'by2' → '18to24by2'
                      ]  # Close the mapping and both if-statements
˜                        # Flatten the list
                         #  i.e. ['1to3',[11],'18to24by2','32to34']
                         #   → ['1to3',11,'18to24by2','32to34']
 ðý                      # And join by spaces (which we implicitly output as result)
                         #  i.e. ['1to3',11,'18to24by2','32to34']
                         #   → '1to3 11 18to24by2 32to34'

0

पर्ल 5 , 154 बाइट्स

{my(@r,$r);@r&&(@$r<2||$$r[1]-$$r[0]==$_-$$r[-1])?push@$r,$_:push@r,$r=[$_]for@_;join" ",map@$_<3?@$_:("$$_[0]to$$_[-1]by".($$_[1]-$$_[0]))=~s/by1$//r,@r}

रिक्त स्थान, newlines, #comments और sub by: के साथ भी

sub by {
  my(@r,$r);
  @r &&                               # if at least one run candidate exists and...
   ( @$r<2                            # ...just one elem so far
     || $$r[1]-$$r[0] == $_-$$r[-1] ) # ...or diff is same
    ? push @$r, $_                    # then add elem to curr. run candidate
    : push @r, $r=[$_]                # else start new run cand. with curr elem
        for @_;
  join " ",
    map @$_<3                                         # is it a run?
    ? @$_                                             # no, just output the numbers
    : ("$$_[0]to$$_[-1]by".($$_[1]-$$_[0]))=~s/by1$//r, # yes, make run, delete by1
    @r                                                # loop run candidates
}

इसे ऑनलाइन आज़माएं!

... ओपी से टेस्ट पास करने के लिए।


0

रेटिना 0.8.2 , 77 बाइट्स

\d+
$*
(1+)(?= \1(1+))
$1:$2
1:(1+) (1+:\1 )+(1+)
1to$3by$1
:1+|by1\b

1+
$.&

इसे ऑनलाइन आज़माएं! लिंक में परीक्षण के मामले शामिल हैं। स्पष्टीकरण:

\d+
$*

यूनीरी में बदलें।

(1+)(?= \1(1+))
$1:$2

लगातार अंतर की गणना करें।

1:(1+) (1+:\1 )+(1+)
1to$3by$1

रन को to...byसिंटैक्स में बदलें ।

:1+|by1\b

असंबद्ध मतभेदों को दूर करें और by1

1+
$.&

दशमलव में परिवर्तित करें।

हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.