working war, implemented two array data structure