Submission Detail

18 / 18 test cases passed.
Status:

Accepted

Runtime: 25 ms
Memory Usage: 13.7 MB
Submitted: 0 minutes ago
loading
Runtime Error Message:
Last executed input:
Input:
Output:
Expected:

Accepted Solutions Runtime Distribution

0
5
10
15
20
25
30
35
40
45
2.5
5.0
7.5
10.0
12.5
python
You are here!
Your runtime beats 17.68 % of python submissions.
Runtime (ms)
Distribution (%)

0
5
10
15
20
25
30
35
40
45
5
10
Zoom area by dragging across this chart

Accepted Solutions Memory Distribution

13200
13250
13300
13350
13400
13450
13500
13550
13600
13650
13700
13750
13800
13850
13900
5
10
15
20
25
python
You are here!
Your memory usage beats 21.26 % of python submissions.
Memory (KB)
Distribution (%)

13200
13250
13300
13350
13400
13450
13500
13550
13600
13650
13700
13750
13800
13850
13900
10
20
Zoom area by dragging across this chart

Invite friends to challenge Is Subsequence


Submitted Code: 0 minutes ago

Language: python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Solution(object):
def isSubsequence(self, s, t):
"""
:type s: str
:type t: str
:rtype: bool
"""
order = []
last_t = 0
for i in range(0,len(s)):
found = False
for j in range(last_t,len(t)):
if (t[j] == s[i]):
found = True
order.append(j)
last_t = j+1
break
if (found == False):
return False
for i in range(0,len(order)-1):
if (order[i] >= order[i+1]):
return False
return True
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX