Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update
  • Loading branch information
wilsoncao committed Feb 14, 2016
commit 286583a8f80354990703eb783b2c36455b7a616d
Binary file added .DS_Store
Binary file not shown.
Binary file added algorithms/.DS_Store
Binary file not shown.
Binary file added algorithms/cpp/.DS_Store
Binary file not shown.
Binary file added algorithms/cpp/majorityElement/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion algorithms/cpp/majorityElement/majorityElement.II.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Solution {
//the same algorithm as Majority Element I problem
int majority1=0, majority2=0, cnt1=0, cnt2=0;
for(auto item: nums) {
if (cnt1 == 0) {
if (cnt1 == 0 && majority2 != item ) {
majority1 = item;
cnt1 = 1;
} else if (majority1 == item) {
Expand Down