You are not logged in. Please login at to post your questions!


BUy1 Get1 . Can somebody review my code.

My code runs within time produces desired results uses the obvious logic but still i am getting wrong answer!! please could someone help me with my following code:-

asked 28 Sep '14, 09:47

mansigupta19's gravatar image

accept rate: 0%

here is your AC code with slight changes


answered 28 Sep '14, 15:58

anshkhanna7's gravatar image

accept rate: 23%

Thanks dude! I would have never figured out that the writing style of if conditions was causing the problem. Could you please also explain why was 97<=*c<=122 was resulting in a WA?

(28 Sep '14, 16:22) mansigupta191★

this does not work because only the first part of condition is taken care of (ie 97<=c) the limiting condition is neglected ie(c<=122)

you can try it yourself

(28 Sep '14, 16:38) anshkhanna74★

You shouldn't consider cases differently


answered 28 Sep '14, 11:17

legend_killer's gravatar image

accept rate: 0%

so a wrong answer is given if a code produces correct output but uses a different approach which is accepted? coz this is happening with me in many problems, logic is exactly as that of accepted code, only method is different :(


answered 28 Sep '14, 14:42

mansigupta19's gravatar image

accept rate: 0%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 28 Sep '14, 09:47

question was seen: 639 times

last updated: 28 Sep '14, 16:38