Rakuten interview question

Two sum problem and substring problem