// 2026년 포트폴리오용 재구성 코드. 실제 업무 당시 소스가 아닙니다. // 2026 portfolio reconstruction. Not original production source or a transport protocol. using System; using System.Collections.Generic; namespace PortfolioExamples { public static class SessionRoleSelector { // Deterministic demonstration using one complete participant list. // Not consensus: inconsistent peer lists can produce split-brain results. public static int SelectCoordinator(IEnumerable participantIds) { if (participantIds == null) throw new ArgumentNullException(nameof(participantIds)); int smallest=int.MaxValue; bool any=false; foreach(int id in participantIds) { if(id<0)throw new ArgumentException("IDs must be nonnegative."); smallest=Math.Min(smallest,id); any=true; } if(!any)throw new ArgumentException("No participants."); return smallest; } } }