Closed
Conversation
Member
|
Hi! Thanks for contributing to this repository. |
Author
|
what is travis checking and why does it fail if my code passed all test cases? |
Member
|
Add Spaces around Binary Operator. |
Member
|
Duplicate of #200 ? |
2017/AUG/AUG17/PALINGAM/PALINGAM.py
Outdated
| @@ -0,0 +1,37 @@ | |||
| #Code Copyright: Amit Sarkar, Computer Science Engineering 2nd Year, BIT Mesra | |||
Member
There was a problem hiding this comment.
The code does not comply to PEP8.
Origin: PEP8Bear, Section: pep8.
The issue can be fixed by applying the following patch:
--- a/tmp/tmpq19l0tf7/2017/AUG/AUG17/PALINGAM/PALINGAM.py
+++ b/tmp/tmpq19l0tf7/2017/AUG/AUG17/PALINGAM/PALINGAM.py
@@ -1,4 +1,4 @@
-#Code Copyright: Amit Sarkar, Computer Science Engineering 2nd Year, BIT Mesra
+# Code Copyright: Amit Sarkar, Computer Science Engineering 2nd Year, BIT Mesra
t = input()
while ( t > 0 ) :
2017/AUG/AUG17/PALINGAM/PALINGAM.py
Outdated
| a = raw_input() | ||
| b = raw_input() | ||
|
|
||
| na = len(a) |
Member
There was a problem hiding this comment.
The code does not comply to PEP8.
Origin: PEP8Bear, Section: pep8.
The issue can be fixed by applying the following patch:
--- a/tmp/tmpq19l0tf7/2017/AUG/AUG17/PALINGAM/PALINGAM.py
+++ b/tmp/tmpq19l0tf7/2017/AUG/AUG17/PALINGAM/PALINGAM.py
@@ -1,37 +1,37 @@
#Code Copyright: Amit Sarkar, Computer Science Engineering 2nd Year, BIT Mesra
t = input()
-while ( t > 0 ) :
- a = raw_input()
- b = raw_input()
-
- na = len(a)
- nb = len(b)
-
- lpa = []
- lpb = []
- for i in range(26):
- lpa.append(0)
- lpb.append(0)
- k2 = ord('a')
- for i in range(na):
- lpa[ ord( a[i] ) - k2 ] = lpa[ ord( a[i] ) - k2 ] + 1
- for i in range(nb):
- lpb[ ord( b[i] ) - k2 ] = lpb[ ord( b[i] ) - k2 ] + 1
- flag = 0
- c1 = 0
- c2 = 1
- for i in range(26):
- if ( lpa[i] >= 2 ) and (lpb[i] == 0 ):
- flag=1
- if ( lpa[i] != 0 ) and ( lpb[i] == 0 ):
- c1 = 1
- if( c1 == 1 ):
- for i in range(26):
- if ( lpb[i] != 0 ) and ( lpa[i] == 0 ):
- c2 = 0
- if ( flag == 1 ) or ( ( c1 == 1 ) and ( c2 == 1 ) ):
- print "A"
- else:
- print "B"
- t=t-1
+while (t > 0):
+ a = raw_input()
+ b = raw_input()
+
+ na = len(a)
+ nb = len(b)
+
+ lpa = []
+ lpb = []
+ for i in range(26):
+ lpa.append(0)
+ lpb.append(0)
+ k2 = ord('a')
+ for i in range(na):
+ lpa[ord(a[i]) - k2] = lpa[ord(a[i]) - k2] + 1
+ for i in range(nb):
+ lpb[ord(b[i]) - k2] = lpb[ord(b[i]) - k2] + 1
+ flag = 0
+ c1 = 0
+ c2 = 1
+ for i in range(26):
+ if (lpa[i] >= 2) and (lpb[i] == 0):
+ flag = 1
+ if (lpa[i] != 0) and (lpb[i] == 0):
+ c1 = 1
+ if(c1 == 1):
+ for i in range(26):
+ if (lpb[i] != 0) and (lpa[i] == 0):
+ c2 = 0
+ if (flag == 1) or ((c1 == 1) and (c2 == 1)):
+ print "A"
+ else:
+ print "B"
+ t = t-1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #212
Problem Code (Contest Code) [Language].