{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n #problem-body \u003e pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"problem-body\"\u003e \n \u003cp\u003eGiven a string of length at most 100,000 consist of alphabets and numbers. Output the suffix array of the string.\u003c/p\u003e \n \u003cp\u003eA \u003ca href\u003d\"//en.wikipedia.org/wiki/Suffix_array\"\u003esuffix array\u003c/a\u003e is an array of integers giving the starting positions (0-based) of suffixes of a string in lexicographical order. Consider a string \"abracadabra0AbRa4Cad14abra\". The size of the suffix array is equal to the length of the string. Below is the list of 26 suffixes of the string along with its starting position sorted in lexicographical order:\u003c/p\u003e \n \u003cpre\u003e\u003cstrong\u003e\u003cspan style\u003d\"font-family: \u0027courier new\u0027, courier; font-size:12px\"\u003ePOS SUFFIX\u003c/span\u003e\u003c/strong\u003e\u003cspan style\u003d\"font-family: \u0027courier new\u0027, courier; font-size:12px\"\u003e\n 11 0AbRa4Cad14abra\n 20 14abra\n 16 4Cad14abra\n 21 4abra\n 12 AbRa4Cad14abra\n 17 Cad14abra\n 14 Ra4Cad14abra\n 25 a\n 10 a0AbRa4Cad14abra\n 15 a4Cad14abra\n 22 abra\n 7 abra0AbRa4Cad14abra\n 0 abracadabra0AbRa4Cad14abra\n 3 acadabra0AbRa4Cad14abra\n 18 ad14abra\n 5 adabra0AbRa4Cad14abra\n 13 bRa4Cad14abra\n 23 bra\n 8 bra0AbRa4Cad14abra\n 1 bracadabra0AbRa4Cad14abra\n 4 cadabra0AbRa4Cad14abra\n 19 d14abra\n 6 dabra0AbRa4Cad14abra\n 24 ra\n 9 ra0AbRa4Cad14abra\n 2 racadabra0AbRa4Cad14abra\u003c/span\u003e\n\u003c/pre\u003e \n \u003cp\u003e\u003cstrong\u003eNote\u003c/strong\u003e: This is a partial scoring problem. Less optimized code will give you a partial score. \u003c/p\u003e \n \u003ch3\u003eInput\u003c/h3\u003e \n \u003cp\u003eA single line containing the string.\u003c/p\u003e \n \u003ch3\u003eOutput\u003c/h3\u003e \n \u003cp\u003eThe suffix array of the string.\u003c/p\u003e \n \u003ch3\u003eExample\u003c/h3\u003e \n \u003cpre\u003e\u003cstrong\u003eInput:\u003c/strong\u003e\nabracadabra0AbRa4Cad14abra\n\n\u003cstrong\u003eOutput:\u003c/strong\u003e\n11\n20\n16\n21\n12\n17\n14\n25\n10\n15\n22\n7\n0\n3\n18\n5\n13\n23\n8\n1\n4\n19\n6\n24\n9\n2\n\u003c/pre\u003e \n\u003c/div\u003e"}}]}