Create Nested Array Python Size Function Java