Resource allocation is one of the major problems in a healthcare system. The problem gets worse during a disaster situation like a pandemic. The demand is high, and the resources are limited, this puts a question on which patient should be admitted. This research focuses on increasing the number of patient admissions by deciding who should be admitted based on the patient's severity and length of stay. In the research, the patient has a fixed length of stay and if a patient is rejected, he/she is rejected forever. The research focuses on one critical resource, and it needs to be available to admit the patient. The daily capacity of resources is fixed. The demand during the pandemic is dynamic, so this research solves the problem using space search optimization which is one of the techniques of dynamic programming. The research uses depth-first and breadth-first space search algorithms. The experiments with randomized data were executed to see the effect of available capacity on the number of admitted patients. This research shows that space search algorithms are useful techniques for the optimization of resources and patients during a pandemic.