Pyth, 8 bytes
x"(|)D"e
Exalanation
x"(|)D"e
: Implicit evaluated input
e : Last element of input
"(|)D" : The string "(|)D"
x : First occurrence of the last element of input in "(|)D"
Mukundan314
- 13.7k
- 1
- 19
- 62
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchangex"(|)D"e
x"(|)D"e
: Implicit evaluated input
e : Last element of input
"(|)D" : The string "(|)D"
x : First occurrence of the last element of input in "(|)D"