cielseven's picture
add benchmark corpora, groundtruth, symexec scripts and coverage docs
bff4ec7
Raw History Blame Contribute Delete
352 Bytes
import AUXLib.Arithmetic
import SimpleC.SL.SeparationLogic
namespace Algorithms.majority_element.lean
open AUXLib
def count (m : Int) : List Int → Int
| [] => 0
| x :: xs => (if x = m then 1 else 0) + count m xs
def IsMajorityElement (m : Int) (l : List Int) : Prop :=
2 * count m l > (l.length : Int)
end Algorithms.majority_element.lean