`{"id":"849d883e-6eb4-44df-8110-71c5011e2caa","name":"Good Substrings","description":"https://codeforces.com/problemset/problem/271/D","inputFormat":"Check link in description","outputFormat":"Check link in description","constraints":"Check link in description","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.*;\r\n\r\npublic class Main{\r\n static class pair{\r\n long a; \r\n long b;\r\n pair(long x,long y){\r\n this.a = x;\r\n this.b = y;\r\n }\r\n public boolean equals(Object o) {\r\n if (o instanceof pair) {\r\n pair p = (pair)o;\r\n return p.a == a && p.b == b;\r\n }\r\n return false;\r\n }\r\n public int hashCode() {\r\n return (Long.valueOf(a).hashCode())* 31 +(Long.valueOf(b).hashCode());\r\n }\r\n }\r\n public static void main(String[] args){\r\n Scanner scn = new Scanner(System.in);\r\n // Write Code here\r\n scn.close();\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"acbacbacaa\r\n00000000000000000000000000\r\n2\r\n","sampleOutput":"8\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"a2073e25-96a1-4875-b400-f40bbe2edd95","name":"Text Processing For Experts","slug":"text-processing-for-experts-859","type":0},{"id":"3eb9e717-a2f9-4e6d-9409-4f09109f9c26","name":"Good Substrings","slug":"good-substrings","type":1}],"next":{"id":"250721e3-8d64-4136-a15b-de0b2e52bd1f","name":"Longest Duplicate Substring","type":1,"slug":"longest-duplicate-substring"},"prev":{"id":"7b80774a-7489-4ac1-9e53-a3f6a6c783e0","name":"Password","type":1,"slug":"password"}}}`

Good Substrings

https://codeforces.com/problemset/problem/271/D

`{"id":"849d883e-6eb4-44df-8110-71c5011e2caa","name":"Good Substrings","description":"https://codeforces.com/problemset/problem/271/D","inputFormat":"Check link in description","outputFormat":"Check link in description","constraints":"Check link in description","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.*;\r\n\r\npublic class Main{\r\n static class pair{\r\n long a; \r\n long b;\r\n pair(long x,long y){\r\n this.a = x;\r\n this.b = y;\r\n }\r\n public boolean equals(Object o) {\r\n if (o instanceof pair) {\r\n pair p = (pair)o;\r\n return p.a == a && p.b == b;\r\n }\r\n return false;\r\n }\r\n public int hashCode() {\r\n return (Long.valueOf(a).hashCode())* 31 +(Long.valueOf(b).hashCode());\r\n }\r\n }\r\n public static void main(String[] args){\r\n Scanner scn = new Scanner(System.in);\r\n // Write Code here\r\n scn.close();\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"acbacbacaa\r\n00000000000000000000000000\r\n2\r\n","sampleOutput":"8\r\n","questionVideo":"","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"a2073e25-96a1-4875-b400-f40bbe2edd95","name":"Text Processing For Experts","slug":"text-processing-for-experts-859","type":0},{"id":"3eb9e717-a2f9-4e6d-9409-4f09109f9c26","name":"Good Substrings","slug":"good-substrings","type":1}],"next":{"id":"250721e3-8d64-4136-a15b-de0b2e52bd1f","name":"Longest Duplicate Substring","type":1,"slug":"longest-duplicate-substring"},"prev":{"id":"7b80774a-7489-4ac1-9e53-a3f6a6c783e0","name":"Password","type":1,"slug":"password"}}}`

Editor

Good Substrings

medium

https://codeforces.com/problemset/problem/271/D

Example

Sample Input

```.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}acbacbacaa 00000000000000000000000000 2 ```

Sample Output

```.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}8 ```

Discussions

Show Discussion

Related Resources