{"id":"db7f331c-e6fc-4345-bcf4-8b5964cba4a7","name":"Remove Adjacent","description":"<a href=\"https://codeforces.com/contest/1321/problem/C\" target=\"_blank\"><i class=\"fa fa-external-link\" aria-hidden=\"true\"> Link -> Remove Adjacent</i></a>","inputFormat":"check the link","outputFormat":"check the link","constraints":"check the link","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.Scanner;\r\n\r\npublic class Main {\r\n public static void main(String[] args) {\r\n Scanner sc = new Scanner(System.in);\r\n\r\n //Code here\r\n\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"8\r\nbacabcab\r\n","sampleOutput":"4\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":"94272f11-e4a8-4ca1-bcc4-7ad899bfa272","name":"Remove Adjacent","slug":"remove-adjacent","type":1}],"next":{"id":"4b72dd30-93a9-41af-aa1d-77208eed73e4","name":"Phoenix And Distribution","type":1,"slug":"phoenix-and-distribution"},"prev":{"id":"85767405-7800-48bd-ac6a-717b81d3aa34","name":"Vitaly And Strings","type":1,"slug":"vitaly-and-strings"}}}

Remove Adjacent

<a href="https://codeforces.com/contest/1321/problem/C" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Remove Adjacent</i></a>

{"id":"db7f331c-e6fc-4345-bcf4-8b5964cba4a7","name":"Remove Adjacent","description":"<a href=\"https://codeforces.com/contest/1321/problem/C\" target=\"_blank\"><i class=\"fa fa-external-link\" aria-hidden=\"true\"> Link -> Remove Adjacent</i></a>","inputFormat":"check the link","outputFormat":"check the link","constraints":"check the link","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.util.Scanner;\r\n\r\npublic class Main {\r\n public static void main(String[] args) {\r\n Scanner sc = new Scanner(System.in);\r\n\r\n //Code here\r\n\r\n }\r\n}"},"ruby":{"code":""},"python":{"code":""},"javascript":{"code":""}},"points":10,"difficulty":"medium","sampleInput":"8\r\nbacabcab\r\n","sampleOutput":"4\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":"94272f11-e4a8-4ca1-bcc4-7ad899bfa272","name":"Remove Adjacent","slug":"remove-adjacent","type":1}],"next":{"id":"4b72dd30-93a9-41af-aa1d-77208eed73e4","name":"Phoenix And Distribution","type":1,"slug":"phoenix-and-distribution"},"prev":{"id":"85767405-7800-48bd-ac6a-717b81d3aa34","name":"Vitaly And Strings","type":1,"slug":"vitaly-and-strings"}}}
plane

Editor


Loading...

Remove Adjacent

medium

Constraints

check the link

Format

Input

check the link

Output

check the link

Example

Sample Input

8 bacabcab

Sample Output

4

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode