Rakuten Interview Question

Two sum problem and substring problem