Skip to content

Instantly share code, notes, and snippets.

@yuheiomori
Created May 9, 2012 23:26
Show Gist options
  • Save yuheiomori/2649693 to your computer and use it in GitHub Desktop.
Save yuheiomori/2649693 to your computer and use it in GitHub Desktop.
CodeEval Rightmost Char
import sys
def rightmost_char(line):
s, t = line.rstrip().split(',')
return s.rfind(t)
if __name__ == '__main__':
test_cases = open(sys.argv[1], 'r')
for line in test_cases:
print rightmost_char(line)
test_cases.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment