Domanda di colloquio di SAP

Leetcode DP question, and some concepts about OOP, JVM, dynamic memory allocation.