Guest User

Untitled

a guest
Oct 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. function func(s, a, b) {
  2. for (let i = s.length - 1; i >= 0; i--) {
  3. if (s.substring(i, i + 1) === a || (s.substring(i, i + 1) === b)) return i;
  4. }
  5. return -1;
  6. }
Add Comment
Please, Sign In to add comment