Non Manifold selection issue in my mesh

Hello Friends,
I need help in solving this issue. I was creating a stack of cube one by one and delete the internal faces.In Edit mode->Select all by trait ->Interior faces is working for the small stack of cubes but it selects the necessary outer faces when increasing the stack size. So instead I am using Select all by trait -> Non Manifold. But in this function its giving different outputs for the same mesh sometimes , so its difficult to automate this. Does anyone know why this Non manifold error occurs differently for the same mesh?
You will get the clearer picture if you have a look at the example I have uploaded.

As you can see sometimes in non manifold selection certain vertices is not being selected. I dont know the reason why its not getting selected.Please help me. Thanks in advance.

A post was merged into an existing topic: Non Manifold selection issue in my mesh