Problem 44075. GJam 2017 Kickstart: Parentheses (Large)
This Challenge is derived from GJam 2017 Kickstart Parentheses. This is the first 100 large cases with 1<=L+R<=10^5.
Google Code Jam 2017 Qualifier is March 7, 2017. Typically four challenges with small and large aspects with 27 hours to complete.
The GJam story is given L left and R right parentheses determine the maximum number of parentheses pairings.
Input: [L,R], the quantity of parentheses types
Output: [V], the maximum number of parentheses pairings
Examples: [L,R] [V]; [3,2] [3]
For the case ()()(, for example, the three balanced groups are () from indexes 1 to 2, () from indexes 3 to 4, and ()() from indexes 1 to 4.
Theory: Brute force permutations and counting will not succeed in a timely manner for L+R=10^5. Determining the inherent mathematical pattern is usually the best way to succeed in GJam. GJam Kickstart solutions(C++,Python).
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers28
Suggested Problems
-
Find the longest sequence of 1's in a binary sequence.
6669 Solvers
-
Find state names that start with the letter N
1428 Solvers
-
Find a subset that divides the vector into equal halves
398 Solvers
-
Cell Counting: How Many Draws?
2368 Solvers
-
Lychrel Number Test (Inspired by Project Euler Problem 55)
110 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!