Skip to content

Instantly share code, notes, and snippets.

View Clemapfel's full-sized avatar

Clem Cords Clemapfel

View GitHub Profile
//
// Copyright 2022 Clemens Cords
// Created on 14.03.22 by clem (mail@clemens-cords.com)
//
#include <jluna.hpp>
using namespace jluna;
// this code are examples given as a response to https://github.com/Clemapfel/jluna/issues/12
@Clemapfel
Clemapfel / why.jl
Last active March 4, 2022 20:24
Find all k-sized subsets of arbitrary integer set such that xor is 0
function set_xor(set::Set{T}) where T
res = undef
front::Bool = true
for e in set
if front
res = e
front = false
else
res = Base.xor(res, e)