We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Min Max Riddle
- Discussions
Min Max Riddle
Min Max Riddle
Sort by
recency
|
112 Discussions
|
Please Login in order to post a comment
My Java 8 code, passing all test-cases, for a Max Score of 60.
(imports & main not provided. That should be available from the coding window)
Solution in javascript, it passes all test cases but 1 and it fails because timeout so i'd say is almost okey, althought im not using stacks or queues:
Chemistry riddles enhance problem solving skills by challenging individuals to think critically, recall specific details, and connect abstract ideas, often requiring them to recognize patterns in chemical behavior.
O(n) using the previous and next smaller element algos and dynamic programming, pass all test.
if u try to use sliding window and iterate over each length, it's O(n^2) and times out. u need to use dynamic programming concepts to achieve O(n).
the max_element inside the last for loop may make the for loop look like O(n^2), but maximalWindow has a total of n element across all maximalWindow[size], so the for loop has O(n) operations in total
in swift