-
Notifications
You must be signed in to change notification settings - Fork 78
[ignore] incrementalreview demo #1892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||
| class Solution: | ||||||||||
| def twoSum(self, nums, target): | ||||||||||
| mapp = {} | ||||||||||
|
|
||||||||||
| for num in nums: | ||||||||||
| if target - num in mapp: | ||||||||||
| return [num, mapp[target - num] | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 Code BugsMissing a closing bracket Details📖 Explanation: The return statement on line 7 is missing its closing bracket, making this a syntax error that will prevent the entire module from loading.
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 Code BugsThis line has a missing closing Details📖 Explanation: Missing closing bracket causes a SyntaxError.
Suggested change
|
||||||||||
| mapp[num] = num | ||||||||||
|
|
||||||||||
| def maxProduct(self, nums): | ||||||||||
| max_prod = nums[0] | ||||||||||
| min_prod = nums[0] | ||||||||||
| result = nums[0] | ||||||||||
|
|
||||||||||
| for i in range(1, len(nums) - 1): | ||||||||||
| num = nums[i] | ||||||||||
| max_prod, min_prod = max(num, max_prod * num, min_prod * num), min(num, max_prod * num, min_prod * num) | ||||||||||
| result = max(result, max_prod) | ||||||||||
|
|
||||||||||
| return result | ||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 Code Bugs
This line is missing the closing bracket
], making it a syntax error that prevents the entire file from being parsed.Details
📖 Explanation: The list literal is never closed, causing a SyntaxError at runtime.