fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin>>t;
  7. while(t--){
  8. string s;
  9. cin>>s;
  10. for(int i=0;i<s.length()-1;i++){
  11. for(int j=i+1;j<s.length()-1;j++){
  12. if(s[i]==s[j]&&i!=j+1){
  13. cout<<s[i]<<"\n";
  14. break;
  15. }
  16. else{
  17. cout<<"."<<"\n";
  18. }
  19. }
  20. }
  21. }
  22. return 0;
  23. }
Success #stdin #stdout 0s 5444KB
stdin
4
datastructures
algorithms
bllaacckkboard
hackerrank
stdout
.
.
.
.
.
.
.
.
.
.
.
.
.
a
.
.
t
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
t
.
.
.
.
r
.
.
u
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
b
l
.
.
.
.
.
.
.
.
.
.
a
.
.
.
.
.
.
a
c
.
.
.
.
.
.
k
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
a
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
r
.
.
.