Buscador de oraciones II

Crea una función que devuelva la oración que contiene la palabra en el índice n. Recuerda incluir el punto final.

Ejemplo resuelto

final String txt = "I love Tesh. My world evolves in hers. My love for life.";

sentenceSearcher(txt, 4) ➞ "My world evolves in hers."
// The word at index 4 is "world".
// The full sentence that contains the word at index 4 is "My world evolves in hers."

Ejemplos

sentenceSearcher(txt, 2) ➞ "I love Tesh."

sentenceSearcher(txt, 5) ➞ "My world evolves in hers."

sentenceSearcher(txt, -1) ➞ "My love for life."
// The index at -1 is the last word.
// The last word is "life".

Notas

  • Todas las oraciones terminarán con un punto final.
  • También debes tener en cuenta los índices negativos.