文字列の最初と最後の文字をつなげて返すような関数を作成しましょう。 もし文字が一つしかない場合、その文字は最初と最後の文字のため、関数はその文字を二回返すようにしておきましょう。

例:

   stringfirstandlast('boring example') = 'be'

Solution Stats

457 Solutions

344 Solvers

Last Solution submitted on Feb 08, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...