Everyday Algorithm

Given a pile of pens, find and discard the ones that do not write anymore

1 assemble pens in a row
2 find paper 
3 while pens remaining in unchecked row
4       scribble on paper with first unchecked pen in row
5       if pen works 
6             place in working pile
7       else
8             place in not working pile

Comments

Popular posts from this blog

Practice Question and Create Project