Ejemplo n.º 1
0
        public NotesFinder CreateNotesFinder(params uint[] notes)
        {
            var nf = new NotesFinder();

            foreach (var note in notes)
            {
                nf.AddNote(note);
            }
            return(nf);
        }
Ejemplo n.º 2
0
 public bool CheckSumOfNotes(uint target, NotesFinder nf)
 {
     if (nf.Find(target) is Stack <NoteItem> notes)
     {
         uint sum = 0;
         foreach (var note in notes)
         {
             sum += note.Quantity * note.Note;
         }
         return(sum == target);
     }
     return(false);
 }