kraftalgo

A - TLD

Let dot be the last position of . in string \(S\).
For every \(i\) \((1 \leq i \leq |S|)\), if \(S_i\) is a ., store the position to dot. Then, print the characters of \(S\) starting from \(S_{dot + 1}\) to the last character.

Time Complexity: \(O(|S|)\)